예제 #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();
        }
예제 #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);
        }
예제 #3
0
 public static GameMap FromTemplate(MapTemplate template)
 {
     return (GameMap) SerializationHelper.ByteArrayToObject(template.BinaryData);
 }