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