Regarding your first problem: It seems that you are missing a closing parenthesis.
creep.attack(hostile == ERR_NOT_IN_RANGE should be
creep.attack(hostile) == ERR_NOT_IN_RANGE.
Posts made by Coelso
OK, let one rephrase one's question. Imagine one was storing a bunch of id-s, let's say for structures to be maintained, and imagine that this list would include walls and ramparts.
How would one go about invoking the magicks of getObjectById of this list w/o incurring the wrath of tslint (pbuh)?
Id<T>can be a union type. So you can do something like:
let id: Id<StructureWall | StructureRampart>; let wallOrRampart: StructureWall | StructureRampart | null = Game.getObjectById(id);
You can read more about union types here: https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html