Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Coelso
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Coelso

    @Coelso

    3
    Posts
    1359
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Coelso Follow

    Posts made by Coelso

    • RE: This weird error.

      Regarding your first problem: It seems that you are missing a closing parenthesis. creep.attack(hostile[0] == ERR_NOT_IN_RANGE should be creep.attack(hostile[0]) == ERR_NOT_IN_RANGE.

      posted in Help
      Coelso
    • RE: Unexpected Syntax error

      Create a RoomPosition object like this: const buildPos = new RoomPosition(pos.x + x, pos.y + y, pos.roomName);

      posted in Technical Issues and Bugs
      Coelso
    • RE: Id<T>

      @adeptofnone said in Id<T>:

      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)?

      The T in 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

      posted in Help
      Coelso