コード例 #1
0
        public Ground(MapMatrix parent,string groundtype, Point coord)
            : base()
        {
            Ramdom gui = new Ramdom();
            groundID = gui.RandomString(32);
            _parent = parent;
            _groundtype = groundtype;
            switch (groundtype) {
                case "W":

                    _damage=10;
                    _absortion= 0.3;
                    break;
                case "D":
                     _damage=30;
                    _absortion= 0.1;
                    break;
                case "S":
                     _damage=15;
                    _absortion= 0.7;
                    break;
                case "P":
                     _damage=2;
                    _absortion= 1;
                    break;
            }
            coordenate = coord;
        }
コード例 #2
0
 public Simulator()
 {
     Screen.EventTriggered += Screen_MouseDoubleClick;
     string mapname = "C:\\temp\\map1.txt";
     mMatrix = new MapMatrix(13, 13, mapname);
     mMatrix.addPlantToGround(10, 10, new DNAPlant("12345678123456781234567812345678"));
     mMatrix.Mapname = mapname;
 }
コード例 #3
0
 public static MapMatrix load_map(string Gamename)
 {
     DMAP map = Context.DMAP.Single(S => S.SAVEGAME == Gamename);
     MapMatrix MapMatrix = new MapMatrix(Gamename, map.MAP_ID);
     MapMatrix.Mapname = map.MAPNAME;
     MapMatrix.X = (int)map.COLUMNS;
     MapMatrix.Y = (int)map.ROWS;
     MapMatrix.IsCiclyFinish = true;
     return MapMatrix;
 }
コード例 #4
0
 public static List<Ground> load_ground(MapMatrix parent)
 {
     var query = Context.DGROUND.Where(S => S.PARENT == parent.MapID);
     List<Ground> list = new List<Ground>();
     int index = 0;
     foreach (DGROUND item in query)
     {
         Ground newGround =
             new Ground(parent, item.GROUNDTYPE, new Point((int)item.X, (int)item.Y));
         newGround.GroundID = item.GROUND_ID;
         newGround.Damage = (int) item.DAMAGE;
         newGround.Absortion = (double)item.ABSORTION;
         list.Add(newGround);
         index++;
     }
     return list;
 }
コード例 #5
0
 public static void save_map(MapMatrix MapMatrix)
 {
     DMAP map = new DMAP();
     map.MAP_ID = MapMatrix.MapID;
     map.MAPNAME = MapMatrix.Mapname;
     map.ROWS = MapMatrix.Y;
     map.COLUMNS = MapMatrix.X;
     map.SAVEGAME = MapMatrix.Savegame;
     Context.AddToDMAP(map);
     Console.WriteLine(Context.SaveChanges());
 }
コード例 #6
0
 public Simulator(MapMatrix MapMatrix)
 {
     Screen.EventTriggered += Screen_MouseDoubleClick;
     mMatrix = MapMatrix;
 }