Exemplo n.º 1
0
        private static BattleRules MapBattleRules(java.lang.Object obj)
        {
            int battlefieldWidth = obj.Invoke<int>("getBattlefieldWidth", "()I", new object[] { });
            int battlefieldHeight = obj.Invoke<int>("getBattlefieldHeight", "()I", new object[] { });
            int numRounds = obj.Invoke<int>("getNumRounds", "()I", new object[] { });
            double gunCoolingRate = obj.Invoke<double>("getGunCoolingRate", "()D", new object[] { });
            long inactivityTime = obj.Invoke<long>("getInactivityTime", "()J", new object[] { });

            MethodInfo method = typeof(BattleRules).GetMethod("createHiddenHelper", BindingFlags.Static | BindingFlags.NonPublic);
            IHiddenRulesHelper rulesHelper = (IHiddenRulesHelper)method.Invoke(null, null);

            return rulesHelper.createRules(battlefieldWidth, battlefieldHeight, numRounds, gunCoolingRate, inactivityTime);
        }
Exemplo n.º 2
0
        private static BattleResults MapBattleResults(java.lang.Object obj)
        {
            string teamLeaderName = obj.Invoke<java.lang.String>("getTeamLeaderName", "()Ljava/lang/String;", new object[] { });
            int rank = obj.Invoke<int>("getRank", "()I", new object[] { });
            int score = obj.Invoke<int>("getScore", "()I", new object[] { });
            int survival = obj.Invoke<int>("getSurvival", "()I", new object[] { });
            int lastSurvivorBonus = obj.Invoke<int>("getLastSurvivorBonus", "()I", new object[] { });
            int bulletDamage = obj.Invoke<int>("getBulletDamage", "()I", new object[] { });
            int bulletDamageBonus = obj.Invoke<int>("getBulletDamageBonus", "()I", new object[] { });
            int ramDamage = obj.Invoke<int>("getRamDamage", "()I", new object[] { });
            int ramDamageBonus = obj.Invoke<int>("getRamDamageBonus", "()I", new object[] { });
            int firsts = obj.Invoke<int>("getFirsts", "()I", new object[] { });
            int seconds = obj.Invoke<int>("getSeconds", "()I", new object[] { });
            int thirds = obj.Invoke<int>("getThirds", "()I", new object[] { });

            return new BattleResults(teamLeaderName, rank, score, survival, lastSurvivorBonus,
                bulletDamage, bulletDamageBonus, ramDamage, ramDamageBonus, firsts, seconds, thirds);
        }
        private static BattleRules MapBattleRules(java.lang.Object obj)
        {
            int battlefieldWidth = obj.Invoke<int>("getBattlefieldWidth", "()I", new object[] { });
            int battlefieldHeight = obj.Invoke<int>("getBattlefieldHeight", "()I", new object[] { });
            int numRounds = obj.Invoke<int>("getNumRounds", "()I", new object[] { });
            double gunCoolingRate = obj.Invoke<double>("getGunCoolingRate", "()D", new object[] { });
            long inactivityTime = obj.Invoke<long>("getInactivityTime", "()J", new object[] { });
            bool hideEnemyNames = obj.Invoke<bool>("getHideEnemyNames", "()Z", new object[] { });
            int sentryBorderSize = obj.Invoke<int>("getSentryBorderSize", "()I", new object[] { });
            int fuelItemInterval = obj.Invoke<int>("getFuelItemInterval", "()I", new object[] { });

            MethodInfo method = typeof(BattleRules).GetMethod("createHiddenHelper", BindingFlags.Static | BindingFlags.NonPublic);
            IHiddenRulesHelper rulesHelper = (IHiddenRulesHelper)method.Invoke(null, null);

            return rulesHelper.createRules(battlefieldWidth, battlefieldHeight, numRounds, gunCoolingRate, inactivityTime, hideEnemyNames, sentryBorderSize, fuelItemInterval);
        }