Exemplo n.º 1
0
        public void ForceModuleAvailable(int moduleId)
        {
            ShipModuleInfo module = GetModule(moduleId);

            if (module != null && module.State == ShipModuleState.Locked)
            {
                module.SetState(ShipModuleState.Available);
            }
        }
Exemplo n.º 2
0
        public void ForceOpenModule(int moduleId)
        {
            ShipModuleInfo module = GetModule(moduleId);

            if (module != null)
            {
                AddModuleCounter(module.Id, 1);
                module.SetState(ShipModuleState.Opened);
            }
        }
Exemplo n.º 3
0
        public ModuleTransactionState BuyModule(int moduleId)
        {
            ShipModuleInfo module = GetModule(moduleId);

            if (module.State == ShipModuleState.Available)
            {
                IPlayerService playerService = Services.PlayerService;
                if (playerService.IsEnough(module.Data.Currency))
                {
                    playerService.RemoveCurrency(module.Data.Currency);
                    AddModuleCounter(module.Id, 1);
                    module.SetState(ShipModuleState.Opened);
                    return(ModuleTransactionState.Success);
                }
                else
                {
                    return(ModuleTransactionState.NotEnoughCurrency);
                }
            }
            else
            {
                return(ModuleTransactionState.NotValidState);
            }
        }