protected override void OnCreateType() { var il = MainMethod.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ret); }
public void TestMethod() { //初始化a角色 var a = new Charactor(); a.HP = 100000; //初始化a的武器 var aWeapon = new Weapon(); aWeapon.AttackType = AttackType.近战; aWeapon.DamageType = DamageType.物理; aWeapon.PhysicalDmg = 10000; aWeapon.Speed = 10000; a.Weapon = aWeapon; //初始化a的药剂: var aMedicine = new Medicine(); aMedicine.NumericalType = NumericalType.百分比; aMedicine.HP = 1; a.MedicineList = new System.Collections.Generic.List <Medicine>(); a.MedicineList.Add(aMedicine); a = MainMethod.Initialize(a); a.BuffList = new System.Collections.Generic.List <Buff>(); var b = new Charactor(); b.HP = 100000; var bWeapon = new Weapon(); bWeapon.AttackType = AttackType.远程; bWeapon.DamageType = DamageType.魔法; bWeapon.MagicDmg = 20000; bWeapon.Speed = 20000; b.Weapon = bWeapon; var bMedicine = new Medicine(); bMedicine.NumericalType = NumericalType.百分比; bMedicine.MagicDmg = 1; b.MedicineList = new System.Collections.Generic.List <Medicine>(); b.MedicineList.Add(bMedicine); b = MainMethod.Initialize(b); b.BuffList = new System.Collections.Generic.List <Buff>(); //把对方加入攻击列表 a.TargetCharactorList = new System.Collections.Generic.List <Charactor>(); a.TargetCharactorList.Add(b); b.TargetCharactorList = new System.Collections.Generic.List <Charactor>(); b.TargetCharactorList.Add(a); //攻击动作 while (a.HP == 0 || b.HP == 0) { MainMethod.Attack(ref a, a.TargetCharactorList); MainMethod.Attack(ref b, b.TargetCharactorList); } }
private LearningUnit ParseUnit(MainMethod method) { switch (method) { case MainMethod.DIGITS: return new LearningDigits(); case MainMethod.FILTER: return new LearningPseudoCNNFilter(); case MainMethod.CNN_L2: return new LearningPseudoCNN(); case MainMethod.CNN_L2_B16: return new LearningPseudoCNN_B16(); case MainMethod.CNN_L2_D48: return new LearningPseudoCNN_D48(); case MainMethod.CNN_L3: return new LearningPseudoCNN_L3(); case MainMethod.CNN_L3_D48: return new LearningPseudoCNN_L3_D48(); case MainMethod.CNN_L3_O2: return new LearningPseudoCNN_L3_O2(); case MainMethod.CNN_L3_I128: return new LearningPseudoCNN_L3_I128(); case MainMethod.CNN_L3_I128_B16: return new LearningPseudoCNN_L3_I128_B16(); case MainMethod.CNN_L4: return new LearningPseudoCNN_L4(); } return null; }
public void ParseMethod(string name) { foreach(MainMethod m in Enum.GetValues(typeof(MainMethod))) { if (m.ToString() == name) Method = m; } }
public Data Start() { var call = new MethodCall("main", null); return(MainMethod.ExecuteMethod(call)); }