public Enum TestRule(Rule rule) { if (fsm.GetRules(state).Contains(rule.name)) { Enum result = rule.Test(context); if (Convert.ToInt32(result) == 0) { DoTransition(rule); AutoTest(); } return result; } return FSM.TestResult.NoRuleError; }
public Enum TestRule(Rule rule, int playerID = -1) { /*TODO*/ if (playerID == -1) (rule as Cyclades.PlayerRule).playerID = (context as Cyclades.Context).CurrentPlayerID; else (rule as Cyclades.PlayerRule).playerID = playerID; System.Console.WriteLine("! " + Serialization.Serialize(rule, true)); Enum res = fsmc.TestRule(rule); System.Console.WriteLine("[" + res + "]"); if (res.ToString() == "OK") _rules_log.Add(rule); return res; }