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; }
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); }
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; } }
public void SetTDTile(TDTile tile) { _tileType = tile._tileType; _tileTrait = tile._tileTrait; }
//Constructor public TDTile(int type, int trait) { _tileType = (TileType)type; _tileTrait = (TileTrait)trait; }
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; }