Navigation

    forum

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

    Pyrodogg

    @Pyrodogg

    2
    Posts
    1021
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Pyrodogg Follow

    Posts made by Pyrodogg

    • RE: Id<T>

      The Id<T> type was added to assist situations like this simple example.

      interface CreepMemory { 
        sourceId: Id<Source>
      }
      
      let source = Game.getObjectById(creep.memory.sourceId)
      

      In this example, the type of source would be Source (or null) because the type of the game object can be known by the type of the Id.

      In this way, you don't need to use something like as Source to type assert it. Consider treating object Ids as something that is typed and not generic strings.

      posted in Help
      Pyrodogg
    • RE: Need to update the TypeScript declare at @types/screeps

      If it makes it any easier to digest the changes and consider working on a PR, I've documented updates in a series of issues in the typed-screeps repository.

      https://github.com/screepers/typed-screeps/issues

      @W4rl0ck looks like a good base for a PR to update the StoreDefinition ☺

      posted in General Discussion
      Pyrodogg