Beispiel #1
0
        public void RemoveCommandsAt(int x, int y)
        {
            Vector vector           = new Vector(x, y);
            var    commandsToRemove = MapGenCommands.Where(m => m.Vector == vector).ToList();

            foreach (var command in commandsToRemove)
            {
                MapGenCommands.Remove(command);
            }
        }
Beispiel #2
0
        public object Clone()
        {
            var clone = new Map(MapKey.Key, DefaultCell);

            clone.Cells           = new Dictionary <MapCoordinate, IEntity>(Cells);
            clone.SeenCoordinates = new HashSet <MapCoordinate>(SeenCoordinates);
            clone.MapGenCommands  = new List <MapGenCommand>(MapGenCommands.Select(c => (MapGenCommand)c.Clone()));
            clone.Vaults          = new List <MapKey>(Vaults);
            clone.Biomes          = new List <Biome>(Biomes);

            return(clone);
        }
Beispiel #3
0
        public void PlaceSubMap(MapCoordinate position, IMap selectedVault)
        {
            position = position - selectedVault.Origin;

            foreach (var cell in selectedVault.Cells)
            {
                SetCell(position + cell.Key.ToVector(), cell.Value);
            }

            foreach (var mapCommand in selectedVault.MapGenCommands)
            {
                var newMapCommand = new MapGenCommand
                {
                    MapGenCommandType = mapCommand.MapGenCommandType,
                    Vector            = mapCommand.Vector + position.ToVector(),
                    Parameters        = mapCommand.Parameters
                };
                MapGenCommands.Add(newMapCommand);
            }
        }
Beispiel #4
0
        public bool HasCommandAt(int x, int y)
        {
            Vector vector = new Vector(x, y);

            return(MapGenCommands.Any(m => m.Vector == vector));
        }
Beispiel #5
0
 public void AddCommand(MapGenCommand command)
 {
     MapGenCommands.Add(command);
 }