コード例 #1
0
        private static IEnumerable <CodeInstruction> Transpile(ILGenerator gen, MethodBase original, IEnumerable <CodeInstruction> insns)
        {
            var stage1 = CarpenterMenuPatcher.Transpile(gen, original, insns);

            var ret = new List <CodeInstruction>();

            foreach (var insn in stage1)
            {
                if (insn.opcode == OpCodes.Isinst && (Type)insn.operand == typeof(Farm))
                {
                    insn.operand = typeof(BuildableGameLocation);
                }
                ret.Add(insn);
            }

            return(ret);
        }
コード例 #2
0
 /// <summary>The method which transpiles <see cref="CarpenterMenu.tryToBuild"/>.</summary>
 private static IEnumerable <CodeInstruction> Transpile_TryToBuild(ILGenerator gen, MethodBase original, IEnumerable <CodeInstruction> insns)
 {
     return(CarpenterMenuPatcher.Transpile(gen, original, insns));
 }