Ejemplo n.º 1
0
        public static bool Prefix(int amount, ItemClass.Service service, ItemClass.SubService subService,
                                  ItemClass.Level level, int taxRate, ref int __result)
        {
            if (DontRunPatch)
            {
                return(true);
            }

            // This method is only called from the simulation tick, so only execute it on the server
            if (MultiplayerManager.Instance.CurrentRole == MultiplayerRole.Client)
            {
                __result = amount;
                return(false);
            }

            ResourceCommandHandler.Queue(new EconomyResourceCommand()
            {
                Action         = ResourceAction.PRIVATE,
                ResourceAmount = amount,
                Service        = service,
                SubService     = subService,
                Level          = level,
                TaxRate        = taxRate
            });
            return(true);
        }
Ejemplo n.º 2
0
        public static void Postfix(Resource resource, ItemClass.Service service, ItemClass.SubService subService,
                                   ItemClass.Level level, ref int __result, ref bool __state)
        {
            if (!__state)
            {
                return;
            }

            ResourceCommandHandler.Queue(new EconomyResourceCommand()
            {
                Action         = ResourceAction.FETCH,
                ResourceType   = resource,
                ResourceAmount = __result,
                Service        = service,
                SubService     = subService,
                Level          = level
            });
        }
Ejemplo n.º 3
0
        public static void Postfix(Resource resource, ItemClass.Service service, ItemClass.SubService subService,
                                   ItemClass.Level level, DistrictPolicies.Taxation taxationPolicies, int amount, ref bool __state)
        {
            AddPrivateIncome.DontRunPatch = false;

            if (!__state)
            {
                return;
            }

            ResourceCommandHandler.Queue(new EconomyResourceCommand()
            {
                Action         = ResourceAction.ADD,
                ResourceType   = resource,
                ResourceAmount = amount,
                Service        = service,
                SubService     = subService,
                Level          = level,
                Taxation       = taxationPolicies
            });
        }