Skip to content

Commit

Permalink
refactor: rename Brand to AttachRole
Browse files Browse the repository at this point in the history
  • Loading branch information
Jomik committed Dec 22, 2023
1 parent 541a4dc commit 7d8f850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/screeps-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const body: BodyPartConstant[] = [WORK, WORK, CARRY, MOVE];
// Sample inputs for Game.map.findRoute testing
const anotherRoomName: Room = Game.rooms.W10S11;

type Brand<T extends string, O extends object & Partial<Record<"role", never>>> = { role: T } & O;
type AttachRole<T extends string, O extends object & Partial<Record<"role", never>>> = { role: T } & O;

interface MinerMemory {
sourceId: Id<Source>;
Expand All @@ -33,7 +33,7 @@ interface CommonCreepMemory {
lastHits: number;
}

type MyCreepMemory = CommonCreepMemory & (Brand<"miner", MinerMemory> | Brand<"upgrader", UpgraderMemory>);
type MyCreepMemory = CommonCreepMemory & (AttachRole<"miner", MinerMemory> | AttachRole<"upgrader", UpgraderMemory>);

// Sample memory extensions
interface Memory {
Expand Down

0 comments on commit 7d8f850

Please sign in to comment.