/** * Set the town index for a road or house tile. * @param t the tile * @param index the index of the town * @pre TileMap.IsTileType(t, TileType.MP_HOUSE) or TileMap.IsTileType(t, TileType.MP_ROAD) but not a road depot */ public static void SetTownIndex(this TileIndex t, TownID index) { Debug.Assert(TileMap.IsTileType(t, TileType.MP_HOUSE) || (TileMap.IsTileType(t, TileType.MP_ROAD) && !t.IsRoadDepot())); Map._m[t].m2 = index; }
/** * Get the index of which town this house/street is attached to. * @param t the tile * @pre TileMap.IsTileType(t, TileType.MP_HOUSE) or TileMap.IsTileType(t, TileType.MP_ROAD) but not a road depot * @return TownID */ public static TownID GetTownIndex(this TileIndex t) { Debug.Assert(TileMap.IsTileType(t, TileType.MP_HOUSE) || (TileMap.IsTileType(t, TileType.MP_ROAD) && !t.IsRoadDepot())); return(Map._m[t].m2); }