Ejemplo n.º 1
0
        public WorldSpace AddCell(WorldSpaceCell cell)
        {
            if (GetAt(cell.X, cell.Y, cell.Z) != null)
                throw new InvalidOperationException("There is already a cell at this location.");

            _cells.Add(cell);

            return this;
        }
Ejemplo n.º 2
0
        public V2 CalculatePosition(WorldSpaceCell cell)
        {
            var pos = new V2(
                cell.X * TileStepX + (cell.Y % 2 == 1 ? OddRowXOffset : 0),
                cell.Y * TileStepY + (HeightTileOffset * cell.Z));

            System.Diagnostics.Debug.WriteLine(pos.X + ", " + pos.Y);

            return pos;
        }
Ejemplo n.º 3
0
        public WorldSpace AddCell(WorldSpaceCell cell)
        {
            if (GetAt(cell.X, cell.Y, cell.Z) != null)
            {
                throw new InvalidOperationException("There is already a cell at this location.");
            }

            _cells.Add(cell);

            return(this);
        }