public LibGroup() { HL = new HeroLib(); TL = new TuxLib(); NL = new NPCLib(); ML = new MonsterLib(); EL = new EvenementLib(); SL = new SkillLib(); ZL = new OperationLib(); NJL = new NCActionLib(); RL = new RuneLib(); ESL = new ExspLib(); }
// Action class, 0 thread receives and maintain data base. // Input class, player.Uid thread receives and maintain data base. public IDictionary<string, Operation> RegisterDelegates(OperationLib lib) { OperationCottage oc = this; IDictionary<string, Operation> cz01 = new Dictionary<string, Operation>(); foreach (Operation cz in lib.Firsts) { cz01.Add(cz.Code, cz); string czCode = cz.Code; var methodAction = oc.GetType().GetMethod(czCode + "Action"); if (methodAction != null) cz.Action += new Operation.ActionDelegate(delegate(Player player, string fuse, string argst) { methodAction.Invoke(oc, new object[] { player, fuse, argst }); }); var methodValid = oc.GetType().GetMethod(czCode + "Valid"); if (methodValid != null) cz.Valid += new Operation.ValidDelegate(delegate(Player player, string fuse) { return (bool)methodValid.Invoke(oc, new object[] { player, fuse }); }); var methodInput = oc.GetType().GetMethod(czCode + "Input"); if (methodInput != null) cz.Input += new Operation.InputDelegate(delegate(Player player, string fuse, string prev) { return (string)methodInput.Invoke(oc, new object[] { player, fuse, prev }); }); } return cz01; }
public LibGroup(HeroLib hl, TuxLib tl, NPCLib nl, MonsterLib ml, EvenementLib el, SkillLib sl, OperationLib zl, NCActionLib njl, RuneLib rl, ExspLib esl) { HL = hl; TL = tl; NL = nl; ML = ml; EL = el; SL = sl; ZL = zl; NJL = njl; RL = rl; ESL = esl; }