Esempio n. 1
0
        public void SpawnLevelTiles()
        {
            foreach (GameSlot slot in tileSlots)
            {
                GameObjectManager     manager = sSystemRegistry.GameObjectManager;
                PyroGameObjectFactory factory = (PyroGameObjectFactory)sSystemRegistry.GameObjectFactory;

                GameObject tile = factory.SpawnTileEmpty(0, 0);
                manager.Add(tile);

                slot.Setup(GameSlotStatus.Empty, null);

                tile.SetPosition(GetSlotLocation(slot.Position));
            }
        }
Esempio n. 2
0
        public FixedSizeArray <GameSlot> GenerateSlots()
        {
            int slotCount = GameWidthInSlots * (GameHeightInSlots);
            FixedSizeArray <GameSlot> result = new FixedSizeArray <GameSlot>(slotCount);

            GameObjectManager     manager = sSystemRegistry.GameObjectManager;
            PyroGameObjectFactory factory = (PyroGameObjectFactory)sSystemRegistry.GameObjectFactory;

            for (int xx = 0; xx < slotCount; xx++)
            {
                int xPos = xx / GameWidthInSlots;
                int yPos = xx % GameWidthInSlots;

                GameObject emptyTile = factory.SpawnTileEmpty(xPos, yPos);
                manager.Add(emptyTile);

                GameSlot slot = new GameSlot(xPos, yPos);

                result.Add(slot);
            }

            return(result);
        }