Exemple #1
0
        public void CreateMapFromDatabase()
        {
            MapRepository maprepo = new MapRepository(new Persistencies.MSSQL_Server());

            string            randomMap      = maprepo.GetRandomMapName();
            List <NormalCell> normalcellList = maprepo.GetNormalCells(randomMap, CellSize);

            for (int i = 0; i < normalcellList.Count; i++)
            {
                CellArray[normalcellList[i].Location.X / CellSize.Width, normalcellList[i].Location.Y / CellSize.Height] = normalcellList[i];
            }

            List <WallCell> wallcellList = maprepo.GetWallCells(randomMap, CellSize);

            for (int i = 0; i < wallcellList.Count; i++)
            {
                CellArray[wallcellList[i].Location.X / CellSize.Width, wallcellList[i].Location.Y / CellSize.Height] = wallcellList[i];
            }
            SpawnPowerUps();
        }