This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code by xTwisteDx aka MKaulfers (https://www.github.com/mkaulfers) | |
// Example usage | |
const someComp = new BodyComp(300) // assuming 300 energy available | |
.work(1, 3, 0.2) // at least 1 work part, up to 3, with a ratio of 20% | |
.move(1, undefined, 0.5) // at least 1 move part, up to 2, with a ratio of 50% | |
.carry(1, 2) // at least 1 carry part, up to 2 | |
const someBody: BodyPartConstant[] = someComp.body() | |
console.log(someBody) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LedgerEntry } from "./LedgerEntry"; | |
export class Matcher { | |
creeps: Creep[]; | |
entries: LedgerEntry[]; | |
creepsFree: { [creepId: string]: boolean }; | |
entriesFree: { [entryId: string]: boolean }; | |
creepPrefs: Map<Creep, LedgerEntry[]>; | |
entryPrefs: Map<LedgerEntry, Creep[]>; | |
assignments: Map<Creep, LedgerEntry>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// IndefiniteProgressIndicator.swift | |
// | |
// Created by Matthew Kaulfers on 2/29/24. | |
// | |
import SwiftUI | |
struct IndefiniteProgressIndicator: View { | |
@State private var rotate1 = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@Namespace var animation | |
@Namespace var backgroundID | |
@State var showingFullScreen = false | |
var body: some View { | |
TabView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/homebrew/bin/python3 | |
# Function to check if a command exists | |
command_exists() { | |
command -v "$1" &> /dev/null | |
} | |
# Variables | |
GITHUB_REPO="https://github.com/iconoir-icons/iconoir/tree/main/icons" | |
ASSETS_DIR="Sources/Iconoir/Assets.xcassets" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static validPos(x: number, y: number, size: number, room: Room): boolean { | |
if (x < 0 || y < 0) return false | |
if (x >= 50 || y >= 50) return false | |
if (x - Math.floor(size / 2) < 0 || y - Math.floor(size / 2) < 0) return false | |
if (x + Math.floor(size / 2) >= 50 || y + Math.floor(size / 2) >= 50) return false | |
let results = room.lookAtArea( | |
y - Math.floor(size / 2), | |
x - Math.floor(size / 2), | |
y + Math.floor(size / 2), |