// Action class, 0 thread receives and maintain data base. // Input class, player.Uid thread receives and maintain data base. public IDictionary<string, Rune> RegisterDelegates(RuneLib lib) { RuneCottage rc = this; IDictionary<string, Rune> sf01 = new Dictionary<string, Rune>(); foreach (Rune sf in lib.Firsts) { sf01.Add(sf.Code, sf); string sfCode = sf.Code; var methodAction = rc.GetType().GetMethod(sfCode + "Action"); if (methodAction != null) sf.Action += new Rune.ActionDelegate(delegate(Player player, string fuse, string argst) { methodAction.Invoke(rc, new object[] { player, fuse, argst }); }); var methodValid = rc.GetType().GetMethod(sfCode + "Valid"); if (methodValid != null) sf.Valid += new Rune.ValidDelegate(delegate(Player player, string fuse) { return (bool)methodValid.Invoke(rc, new object[] { player, fuse }); }); var methodInput = rc.GetType().GetMethod(sfCode + "Input"); if (methodInput != null) sf.Input += new Rune.InputDelegate(delegate(Player player, string fuse, string prev) { return (string)methodInput.Invoke(rc, new object[] { player, fuse, prev }); }); } return sf01; }
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; }