예제 #1
0
        public void CmdCreateMap(int unitNum, int width, int height, int minWallNum, int maxWallNum, int minObjectNum, int maxObjectNum)
        {
            MapParameters mapParam = MapGenerator.Generate(unitNum, width, height, minWallNum, maxWallNum, minObjectNum, maxObjectNum);

            // Calls every client.
            RpcCreateMap(mapParam);
        }
예제 #2
0
 public Map(MapParameters mapParam)
 {
     Cells = new Dictionary <Coordinates, Cell>();
     for (int i = 0; i < mapParam.Count; ++i)
     {
         Cell             cell         = new Cell(mapParam.Positions[i], mapParam.Tiles[i]);
         ObjectParameters objectParams = mapParam.Objects[i];
         if (objectParams.Type != ObjectType.None)
         {
             new BasicObject(cell, objectParams.Type);
         }
         UnitParameters unitParams = mapParam.Units[i];
         if (unitParams.Class != ClassTag.None)
         {
             new BasicUnit(cell, unitParams.Facing, unitParams.Class);
         }
         Cells[mapParam.Positions[i]] = cell;
     }
 }
예제 #3
0
 private void RpcCreateMap(MapParameters mapParam)
 {
     // Notifies GameController that map is created.
     this.PostNotification(MapCreated, new Map(mapParam));
 }