예제 #1
0
 public EditLevelViewModel(GameWorld gameWorld, Point currentPoint)
 {
     CurrentPoint = currentPoint;
     GameWorld = gameWorld;
     MapGraphicsTileSet = new MapGraphicsTileSet(System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "\\MapTiles.xml");
     _errorTilePosition = -1;
 }
예제 #2
0
        public static void SaveMap(string filePath, GameWorld world)
        {
            Stream stream = File.Open(filePath, FileMode.Create);
            BinaryFormatter bf = new BinaryFormatter();

            bf.Serialize(stream, world);
            stream.Close();
        }
예제 #3
0
        /// <summary>
        /// Contstructor Method
        /// </summary>
        /// <param name="points">A list of points used to determine where to grab tiles from</param>
        public BuildMap(List<PointLatLng> points)
        {
            _backgroundWorker = new System.ComponentModel.BackgroundWorker();
            _points = points;
            _mapGraphicsTileSet = new MapGraphicsTileSet(System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "\\MapTiles.xml");
            _gameWorld = new GameWorld();

            _backgroundWorker.WorkerReportsProgress = true;
            _backgroundWorker.WorkerSupportsCancellation = true;
            _backgroundWorker.DoWork += new DoWorkEventHandler(_backgroundWorker_DoWork);
        }
예제 #4
0
 public EditLevel(GameWorld gameWorld)
 {
     InitializeComponent();
 }