Пример #1
0
        public List<LevelGraphPath> NeighborPaths; // For caching

        public bool HasTrait(TileTrait trait)
        {
            if (this.Traits == null)
                return false;

            foreach (TileTrait entry in this.Traits)
            {
                if (entry == trait)
                    return true;
            }
            return false;
        }
Пример #2
0
        public List <LevelGraphPath> NeighborPaths; // For caching

        public bool HasTrait(TileTrait trait)
        {
            if (this.Traits == null)
            {
                return(false);
            }

            foreach (TileTrait entry in this.Traits)
            {
                if (entry == trait)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
 private void GrabTrait()
 {
     switch (_tileType) {
     case TileType.Grass:
     case TileType.DirtToGrassTL:
     case TileType.DirtToGrassT:
     case TileType.DirtToGrassTR:
     case TileType.DirtToGrassL:
     case TileType.Dirt:
     case TileType.DirtToGrassR:
     case TileType.DirtToGrassBL:
     case TileType.DirtToGrassB:
     case TileType.DirtToGrassBR:
         _tileTrait = TileTrait.PASSABLE;
         break;
         /*
      * Save for later
     case TileType.TreeOnGrass:
     case TileType.Wall:
     case TileType.Water:
     case TileType.Lava:
     */
     default:
         _tileTrait = TileTrait.IMPASSABLE;
         break;
     }
 }
Пример #4
0
 public void SetTDTile(TDTile tile)
 {
     _tileType = tile._tileType;
     _tileTrait = tile._tileTrait;
 }
Пример #5
0
 //Constructor
 public TDTile(int type, int trait)
 {
     _tileType = (TileType)type;
     _tileTrait = (TileTrait)trait;
 }
Пример #6
0
    private LevelGraphTile createTile(Vector2 position, GameObject go, TileState state, TileTrait[] traits)
    {
        LevelGraphTile tile = new LevelGraphTile();
        tile.Position = position;
        tile.GameObject = go;
        tile.State = state;
        tile.Traits = traits;

        colorizeTile(tile);
        return tile;
    }