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(); }
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; }
public IDictionary<string, NCAction> RegisterDelegates(NCActionLib lib) { NPCCottage njc = this; IDictionary<string, NCAction> nj01 = new Dictionary<string, NCAction>(); foreach (NCAction nj in lib.Firsts) { nj01.Add(nj.Code, nj); string njCode = nj.Code; var methodAction = njc.GetType().GetMethod(njCode + "Action"); if (methodAction != null) nj.Action += new NCAction.ActionDelegate(delegate (Player player, string fuse, string argst) { methodAction.Invoke(njc, new object[] { player, fuse, argst }); }); var methodValid = njc.GetType().GetMethod(njCode + "Valid"); if (methodValid != null) nj.Valid += new NCAction.ValidDelegate(delegate (Player player, string fuse) { return (bool)methodValid.Invoke(njc, new object[] { player, fuse }); }); var methodInput = njc.GetType().GetMethod(njCode + "Input"); if (methodInput != null) nj.Input += new NCAction.InputDelegate(delegate (Player player, string fuse, string prev) { return (string)methodInput.Invoke(njc, new object[] { player, fuse, prev }); }); var methodEscueAction = njc.GetType().GetMethod(njCode + "EscueAction"); if (methodEscueAction != null) nj.EscueAction += (p, ut, t, f, a) => { methodEscueAction.Invoke(njc, new object[] { p, ut, t, f, a }); }; var methodEscueValid = njc.GetType().GetMethod(njCode + "EscueValid"); if (methodEscueValid != null) nj.EscueValid += (p, ut, t, f) => { return (bool)methodEscueValid.Invoke(njc, new object[] { p, ut, t, f }); }; var methodEscueInput = njc.GetType().GetMethod(njCode + "EscueInput"); if (methodEscueInput != null) nj.EscueInput += (p, ut, t, f, pv) => { return (string)methodEscueInput.Invoke(njc, new object[] { p, ut, t, f, pv }); }; } return nj01; }