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;
 }
Exemple #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();
        }
Exemple #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);
        }
 public EditLevel(GameWorld gameWorld)
 {
     InitializeComponent();
 }