Ejemplo n.º 1
0
        public Tile Parse(XYCoord coord, char input)
        {
            Tile tileNorth;
            Tile tileWest;

            AllPositions.TryGetValue(new XYCoord(coord.X, coord.Y - 1), out tileNorth);
            AllPositions.TryGetValue(new XYCoord(coord.X - 1, coord.Y), out tileWest);

            Tile newTile = null;

            switch (input)
            {
            case 'G': newTile = new Goblin(coord, tileNorth, tileWest); break;

            case 'E': newTile = new Elf(coord, tileNorth, tileWest); break;

            case '.': newTile = new Tile(coord, tileNorth, tileWest, TileType.Floor); break;

            case 'e': newTile = new Elf(coord, tileNorth, tileWest)
            {
                    IsStaticTestGuy = true
            }; break;
            }

            if (newTile != null)
            {
                AllPositions.Add(coord, newTile);
            }

            return(newTile);
        }
Ejemplo n.º 2
0
        public Tile(XYCoord coord, Tile north, Tile west, TileType type)
        {
            HP   = 0;
            AP   = 0;
            Type = type;

            this.coord = coord;
            Neighbours = new List <Tile>();

            if (north != null)
            {
                Link(north, true);
            }
            if (west != null)
            {
                Link(west, true);
            }
        }
Ejemplo n.º 3
0
 public Elf(XYCoord coord, Tile north, Tile west) : base(coord, north, west, TileType.Elf)
 {
     HP = Solution.ELF_HP;
     AP = Solution.ELF_AP;
 }
Ejemplo n.º 4
0
 public Goblin(XYCoord coord, Tile north, Tile west) : base(coord, north, west, TileType.Goblin)
 {
     HP = Solution.GOBLIN_HP;
     AP = Solution.GOBLIN_AP;
 }