public static AttRule Creat(AttRuleCtrl ctrl, SkEntity skEntity, int ruleID) { AttRuleData data = AttRuleData.GetRuleData(ruleID); if (null != data) { AttRule rule = new AttRule(); rule.mFilter = new AttFilterCtrl(skEntity, data.mFilter, rule.CheckAction); rule.mCond = new AttCondCtrl(skEntity, data.mCond); rule.mAction = new AttActionCtrl(ctrl, skEntity, data.mAction); return(rule); } return(null); }
public static void LoadData() { _RuleData = new Dictionary <int, AttRuleData>(); SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("AttRule"); reader.Read(); // Firstline is exp while (reader.Read()) { AttRuleData addData = new AttRuleData(); addData.mID = Convert.ToInt32(reader.GetString(reader.GetOrdinal("id"))); addData.mFilter = reader.GetString(reader.GetOrdinal("filter")); addData.mCond = reader.GetString(reader.GetOrdinal("condition")); addData.mAction = reader.GetString(reader.GetOrdinal("action")); } }