Beispiel #1
0
        public MapSimulator(MapTemplate template)
        {
            // We assign the map inside here
            GameMap = GameMap.FromTemplate(template);
            EntityCollection = new EntityCollection();

            // Register all the services we want here
            RegisterServices();
        }
Beispiel #2
0
        public void SetBinding(object contentObject)
        {
            var genericTemplate = contentObject as IContentTemplate;
            _template = contentObject as MapTemplate;

            TabText = "[" + "Map" + "] " + genericTemplate.Name;
            Text = "[" + "Map" + "] " + genericTemplate.Name;
            Update();
            Invalidate();

            // Get our map
            var map = GameMap.FromTemplate(_template);
            Map = map;

            mapView.SetMap(map);

            TransactionMananger = new MapTransactionMananger(Map);
            TransactionMananger.TransactionPerformed += TransactionPerformed;
            TransactionMananger.TransactionUnperformed += TransactionUnperformed;
            UndoManager = new UndoManager(TransactionMananger);
        }
Beispiel #3
0
 public static GameMap FromTemplate(MapTemplate template)
 {
     return (GameMap) SerializationHelper.ByteArrayToObject(template.BinaryData);
 }