Exemplo n.º 1
0
		public void MapSwapped() {
			if (ActionManager != null) {
				ActionManager.Changed -= new EventHandler(onActionExecuted);
				ActionManager.ExecuteUndo -= new EventHandler(onUndo);
				ActionManager.ExecuteRedo -= new EventHandler(onRedo);
			}

			ActionManager = EditorEngine.Instance.GetActionManager();

			ActionManager.Changed += new EventHandler(onActionExecuted);
			ActionManager.ExecuteUndo += new EventHandler(onUndo);
			ActionManager.ExecuteRedo += new EventHandler(onRedo);

			listActions.Items.Clear();

			foreach (IAction action in EditorEngine.Instance.GetActionManager().Actions) {
				ListViewItem result = new ListViewItem(action.Name);
				result.SubItems.Add(new System.Windows.Forms.ListViewItem.ListViewSubItem(result, action.Time.ToString()));
				result.SubItems.Add(new System.Windows.Forms.ListViewItem.ListViewSubItem(result, "" + 1337));
				listActions.Items.Add(result);
			}
		}
Exemplo n.º 2
0
		public ActionManager GetActionManager(Map map) {
			if (map != null) {
				if (ActionManagers.ContainsKey(map.Name)) {
					return ActionManagers[map.Name];
				} else {
					ActionManager result = new ActionManager();
					ActionManagers.Add(map.Name, result);
					return result;
				}
			}
			return null;
		}