예제 #1
0
        private void SetupFloorItems(Tile tile)
        {
            FloorActuatorCreator.CreateSetupActuators(tile);

            var itemCreator = new LegacyItemCreator(this);
            var tileData    = CurrentMap[tile.GridPosition.X, tile.GridPosition.Y];

            tileData.GrabableItems.ForEach(x => tile.SubItems.Add(itemCreator.CreateItem(x, tile)));

            //TODO creatures
            var creatureCreator = new CreatureCreator(this);

            foreach (var creatre in tileData.Creatures.Where(i => !i.Processed))
            {
                creatures.AddRange(creatureCreator.AddCreature(creatre, tile));
            }
        }
예제 #2
0
        private void Initialize(int level, Point?startTile)
        {
            CurrentLevel         = level;
            CurrentMap           = Data.Maps[level];
            legacyTileCreator    = new LegacyTileCreator(this);
            WallActuatorCreator  = new WallActuatorCreator(this);
            FloorActuatorCreator = new FloorActuatorCreator(this);
            ItemCreator          = new LegacyItemCreator(this);
            creatures            = new List <Creature>();
            InitializeMapTextures();

            outputTiles    = new List <Tile>();
            stack          = new Stack <TileInfo <TileData> >();
            start          = startTile ?? new Point(Data.StartPosition.Position.X, Data.StartPosition.Position.Y);
            TilesPositions = new Dictionary <Point, Tile>();
            bitMap         = new BitMapMemory(CurrentMap.OffsetX, CurrentMap.OffsetY, CurrentMap.Width, CurrentMap.Height);
        }
예제 #3
0
        private void Initialize(int level, Point? startTile)
        {
            CurrentLevel = level;
            CurrentMap = Data.Maps[level];
            legacyTileCreator = new LegacyTileCreator(this);
            WallActuatorCreator = new WallActuatorCreator(this);
            FloorActuatorCreator = new FloorActuatorCreator(this);
            ItemCreator = new LegacyItemCreator(this);
            creatures = new List<Creature>();
            InitializeMapTextures();

            outputTiles = new List<Tile>();
            stack = new Stack<TileInfo<TileData>>();
            start = startTile ?? new Point(Data.StartPosition.Position.X, Data.StartPosition.Position.Y);
            TilesPositions = new Dictionary<Point, Tile>();
            bitMap = new BitMapMemory(CurrentMap.OffsetX, CurrentMap.OffsetY, CurrentMap.Width, CurrentMap.Height);
        }