public RotationGame(IContainer container, IBoard board, IBoardFiller boardFiller, IGameEventDispatcher gameEventDispatcher, IAnimationEngine animationEngine, IGameStateController gameStateController) { _container = container; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; _board = board; _boardFiller = boardFiller; _animationEngine = animationEngine; _gameStateController = gameStateController; GameEvents.Dispatcher = gameEventDispatcher; }
public void addEventListenerCL(string objectName, uint type, Action <GameEvent> listener) { if (!_dispatcherMap.ContainsKey(objectName)) { DebugTrace.print("ERR addEventListenerCL [" + objectName + "] not exsit!"); return; } IGameEventDispatcher ged = _dispatcherMap[objectName]; ged.addEventListener(type, listener); }
public void removeEventListenerCL(string objectName, uint type, Action <GameEvent> listener) { bool flag = !this._dispatcherMap.ContainsKey(objectName); if (flag) { DebugTrace.print("ERR removeEventListenerCL [" + objectName + "] not exsit!"); } else { IGameEventDispatcher gameEventDispatcher = this._dispatcherMap[objectName]; gameEventDispatcher.removeEventListener(type, listener); } }
public bool dispatchEventCL(string objectName, GameEvent evt) { if (!_dispatcherMap.ContainsKey(objectName)) { DebugTrace.print("ERR dispatchEventCL [" + objectName + "] not exsit!"); return(false); } IGameEventDispatcher ged = _dispatcherMap[objectName]; ged.dispatchEvent(evt); return(true); }
public void regEventDispatcher(string objectName, IGameEventDispatcher ed) { if (_dispatcherMap.ContainsKey(objectName)) { DebugTrace.print("ERR regEventDispatcher [" + objectName + "] exsit!"); return; } if (ed == null) { DebugTrace.print("ERR regEventDispatcher [" + objectName + "] null!"); return; } _dispatcherMap[objectName] = ed; }
public bool hasEventListenerCL(string objectName, uint type) { bool flag = !this._dispatcherMap.ContainsKey(objectName); bool result; if (flag) { DebugTrace.print("ERR hasEventListenerCL [" + objectName + "] not exsit!"); result = false; } else { IGameEventDispatcher gameEventDispatcher = this._dispatcherMap[objectName]; result = gameEventDispatcher.hasEventListener(type); } return(result); }
public bool dispatchEventCL(string objectName, GameEvent evt) { bool flag = !this._dispatcherMap.ContainsKey(objectName); bool result; if (flag) { DebugTrace.print("ERR dispatchEventCL [" + objectName + "] not exsit!"); result = false; } else { IGameEventDispatcher gameEventDispatcher = this._dispatcherMap[objectName]; gameEventDispatcher.dispatchEvent(evt); result = true; } return(result); }
public void regEventDispatcher(string objectName, IGameEventDispatcher ed) { bool flag = this._dispatcherMap.ContainsKey(objectName); if (flag) { DebugTrace.print("ERR regEventDispatcher [" + objectName + "] exsit!"); } else { bool flag2 = ed == null; if (flag2) { DebugTrace.print("ERR regEventDispatcher [" + objectName + "] null!"); } else { this._dispatcherMap[objectName] = ed; } } }