public void setOperator(string name) { ICompoundOperator op; if (!mOperators.TryGetValue(name, out op)) { throw new NullReferenceException("can not find " + name + "operator!"); } mCurrentOperator = op; mCurrentOperator.reset(); }
public void RegisterOperator(string name, ICompoundOperator operatorAction) { if (mOperators.ContainsKey(name)) { throw new Exception("The operator: " + name + "was exist! "); } if (operatorAction == null) { throw new NullReferenceException("The operator is null. in " + "CompoundManager:RegisterOperator()"); } mOperators[name] = operatorAction; }
public void setOperatorNull() { mCurrentOperator = null; }