示例#1
0
 protected CreationalCommand(ICommandCenter commandCenter, ICharacterFactory characterFactory, IValidator validator, IRandomGenerator random)
     : base(commandCenter, validator)
 {
     this.Validator.ValidateNull(characterFactory, FactoryCannotBeNullMessage);
     this.CharacterFactory = characterFactory;
     this.Random           = random;
 }
示例#2
0
 public CommandCenterMahuaApi(
     IContainerSaver containerSaver,
     ICommandCenter commandCenter)
 {
     _containerSaver = containerSaver;
     _commandCenter  = commandCenter;
 }
示例#3
0
        protected Command(ICommandCenter commandCenter, IValidator validator)
        {
            this.Validator = validator ?? throw new ArgumentNullException(ValidatorCannnotBeNullMessage);

            this.Validator.ValidateNull(commandCenter, CommandCenterCannotBeNullMessage);
            this.CommandCenter = commandCenter;
        }
示例#4
0
 public void Initialize()
 {
     try
     {
         this.model = this.commandCenterService.GetCommandCenter();
         LoadCommandSets(null);
     }
     catch (Exception ex)
     {
         Shutdown(ex.Message);
         return;
     }
 }
示例#5
0
        public Engine(ICommandCenter commandCenter, ICommandParser commandParser, ICommandProcessor commandProcessor,
                      IReader reader, IWriter writer, IValidator validator)
        {
            this.validator = validator ?? throw new ArgumentNullException(ValidatorCannnotBeNullMessage);

            this.validator.ValidateNull(commandCenter, CommandCenterCannotBeNullMessage);
            this.validator.ValidateNull(commandParser, CommandParserCannotBeNullMessage);
            this.validator.ValidateNull(commandProcessor, CommandProcessorCannnotBeNullMessage);
            this.validator.ValidateNull(reader, ReaderCannnotBeNullMessage);
            this.validator.ValidateNull(writer, WriterCannnotBeNullMessage);

            this.commandCenter    = commandCenter;
            this.commandParser    = commandParser;
            this.commandProcessor = commandProcessor;
            this.reader           = reader;
            this.writer           = writer;
        }
示例#6
0
 public EstateOwnService(IShipyard shipyard,
                         ILaboratory laboratory,
                         IIndustrialComplex industrialComplex,
                         ICommandCenter commandCenter,
                         ISynchronizer synchronizer,
                         IMothershipService mothershipService,
                         IUMotherJumpService motherJumpService,
                         IGameUserService gameUserService,
                         IStoreService storeService,
                         IGDetailPlanetService detailPlanetService, ILocalizerService localizer)
 {
     _shipyard            = shipyard;
     _laboratory          = laboratory;
     _industrialComplex   = industrialComplex;
     _commandCenter       = commandCenter;
     _synchronizer        = synchronizer;
     _mothershipService   = mothershipService;
     _motherJumpService   = motherJumpService;
     _gameUserService     = gameUserService;
     _storeService        = storeService;
     _detailPlanetService = detailPlanetService;
     _localizer           = localizer;
 }
        public void TwoNumbersCommandCreatesPlataue(string command)
        {
            // Arrange
            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <ILandingSurface, Plataeu>()
                                  .AddSingleton <IRoverSquadManager, RoverSquadManager>()
                                  .AddSingleton <ICommandCenter, CommandCenter>()
                                  .BuildServiceProvider();
            var commandSplit   = command.Split(' ');
            var expectedWidth  = int.Parse(commandSplit[0]) + 1;
            var expectedHeight = int.Parse(commandSplit[1]) + 1;

            ICommandCenter commandCenter = serviceProvider.GetService <ICommandCenter>();
            var            plateue       = serviceProvider.GetService <ILandingSurface>();

            // Act
            commandCenter.SendCommand(command);

            // Assert
            plateue.Should().NotBeNull();
            plateue.Size.Should().NotBeNull();
            plateue.Size.Width.Should().Be(expectedWidth);
            plateue.Size.Height.Should().Be(expectedHeight);
        }
示例#8
0
        public TestController(IUserSessionService userSessionService, IKernel kernel) : base(userSessionService)
        {
            #region b1

            try
            {
                _commandCenter = kernel.Get <ICommandCenter>();
                _injectMessages.Add("ICommandCenter", _commandCenter.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption ICommandCenter", e.Message);
                throw new Exception(_injectMessages.ToSerealizeString());
            }

            try
            {
                _gameUserService = kernel.Get <IGameUserService>();
                _injectMessages.Add("IGameUserService", _gameUserService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IUserChestHelper", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b2

            try
            {
                _gDetailPlanetService = kernel.Get <IGDetailPlanetService>();
                _injectMessages.Add("IGDetailPlanetService", _gDetailPlanetService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IGDetailPlanetService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _industrialComplex = kernel.Get <IIndustrialComplex>();
                _injectMessages.Add("IIndustrialComplex", _industrialComplex.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IIndustrialComplex", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _motherFactory = kernel.Get <IMotherFactory>();
                _injectMessages.Add("IMotherFactory", _motherFactory.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IMotherFactory", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _mothershipService = kernel.Get <IMothershipService>();
                _injectMessages.Add("IMothershipService", _mothershipService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IMothershipService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b3

            try
            {
                _planetFactory = kernel.Get <IPlanetFactory>();
                _injectMessages.Add("IPlanetFactory", _planetFactory.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IPlanetFactory", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            try
            {
                _shipyard = kernel.Get <IShipyard>();
                _injectMessages.Add("IShipyard", _shipyard.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IShipyard", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _storage = kernel.Get <IStorage>();
                _injectMessages.Add("IStorage", _storage.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IStorage", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b4

            try
            {
                _storageResourcesService = kernel.Get <IStorageResourcesService>();
                _injectMessages.Add("IStorageResourcesService", _storageResourcesService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IStorageResourcesService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _synchronizer = kernel.Get <ISynchronizer>();

                _injectMessages.Add("ISynchronizer", _synchronizer.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption ISynchronizer", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _gSectorsService = kernel.Get <IGSectorsService>();
                _injectMessages.Add("IGSectorsService", _gSectorsService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IGSectorsService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }
            try
            {
                _systemService = kernel.Get <ISystemService>();
                _injectMessages.Add("ISystemService", _systemService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption ISystemService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b5

            try
            {
                _mapAdressService = kernel.Get <IMapAdressService>();
                _injectMessages.Add("IMapAdressService", _mapAdressService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IMapAdressService", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b6


            try
            {
                _npcInitializer = kernel.Get <INpcInitializer>();
                _injectMessages.Add("INpcInitializer", _npcInitializer.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption INpcInitializer", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }


            try
            {
                _mapGInitializer = kernel.Get <IMapGInitializer>();
                _injectMessages.Add("IMapGInitializer", _mapGInitializer.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IMapGInitializer", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }


            try
            {
                _mainInitializer = kernel.Get <IMainInitializer>();
                _injectMessages.Add("IMainInitializer", _mainInitializer.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IMainInitializer", e.Message);

                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion

            #region b7

            try
            {
                _authUsersInitializer = kernel.Get <IAuthUsersInitializer>();
                _injectMessages.Add("IAuthUsersInitializer", _authUsersInitializer.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IAuthUsersInitializer", e.Message);
                throw new Exception(_injectMessages.ToSerealizeString());
            }

            try
            {
                _allianceService = kernel.Get <IAllianceService>();
                _injectMessages.Add("IAllianceService", _allianceService.Test());
            }
            catch (Exception e)
            {
                _injectMessages.Add("exeption IAllianceService", e.Message);
                throw new Exception(_injectMessages.ToSerealizeString());
            }

            #endregion
        }
 public SendParamedicCommand(ICommandCenter commandCenter, IValidator validator)
     : base(commandCenter, validator)
 {
 }
示例#10
0
        public MainGameHub(IServiceProvider svp)
        {
            #region Main

            _svp      = svp;
            _hubCache = _svp.GetService <IMainGameHubLocalStorageCache>();

            #endregion

            #region Main User

            _gameUserService = _svp.GetService <IGameUserService>();
            _allianceService = _svp.GetService <IAllianceService>();
            _channelService  = (ChannelService)_svp.GetService <IChannelService>();

            _mothershipService = _svp.GetService <IMothershipService>();
            _motherJumpService = _svp.GetService <IUMotherJumpService>();
            _storeService      = _svp.GetService <IStoreService>();

            #endregion

            #region World

            _gameTypeService        = _svp.GetService <IGameTypeService>();
            _gGeometryPlanetService = _svp.GetService <IGGeometryPlanetService>();
            _gDetailPlanetService   = _svp.GetService <IGDetailPlanetService>();
            _gSectorsService        = _svp.GetService <IGSectorsService>();
            _mapInfoService         = _svp.GetService <IMapInfoService>();
            _systemService          = _svp.GetService <ISystemService>();
            _worldService           = _svp.GetService <IWorldService>();
            _gUserBookmarkService   = (GUserBookmarkService)_svp.GetService <IGUserBookmarkService>();

            #endregion

            #region builds

            //collections
            _commandCenter     = _svp.GetService <ICommandCenter>();
            _industrialComplex = _svp.GetService <IIndustrialComplex>();
            _laboratory        = _svp.GetService <ILaboratory>();
            _shipyard          = _svp.GetService <IShipyard>();


            //items
            _energyConverter  = _svp.GetService <IEnergyConverter>();
            _extractionModule = _svp.GetService <IExtractionModule>();
            _extractionModule = _svp.GetService <IExtractionModule>();
            _spaceShipyard    = _svp.GetService <ISpaceShipyard>();
            _storage          = _svp.GetService <IStorage>();
            _turels           = _svp.GetService <ITurels>();

            //common
            _unit                    = _svp.GetService <IUnit>();
            _storageResources        = _svp.GetService <IStorageResourcesService>();
            _transferResourceService = _svp.GetService <ITransferResourceService>();

            #endregion

            #region Global User

            _estateOwnService  = _svp.GetService <IEstateOwnService>();
            _synchronizer      = _svp.GetService <ISynchronizer>();
            _estateListService = _svp.GetService <IEstateListService>();
            _journalOutService = _svp.GetService <IJournalOutService>();
            _gameRunner        = _svp.GetService <IGameRunner>();
            _dbProvider        = _svp.GetService <IDbProvider>();

            #endregion

            #region Confederation

            _confederationService = _svp.GetService <IConfederationService>();

            #endregion
        }
示例#11
0
 public ExceptionHandleCommandCenter(
     ICommandCenter commandCenter)
 {
     _commandCenter = commandCenter;
 }
 public InjurePersonCommand(ICommandCenter commandCenter, IValidator validator)
     : base(commandCenter, validator)
 {
 }
示例#13
0
        public CommandCenterViewModel()
        {
            var launcherModel = LauncherModelFactory.GetLauncher("MissileSharp.ThunderMissileLauncher");

            _launcher = new CommandCenter(launcherModel);
        }
示例#14
0
 protected OrderCommand(ICommandCenter commandCenter, IValidator validator)
     : base(commandCenter, validator)
 {
 }
 public AddParamedicCommand(ICommandCenter commandCenter, ICharacterFactory characterFactory, IValidator validator, IRandomGenerator random)
     : base(commandCenter, characterFactory, validator, random)
 {
 }
示例#16
0
 public SendPolicemanCommand(ICommandCenter commandCenter, IValidator validator)
     : base(commandCenter, validator)
 {
 }
示例#17
0
 public MarsRoverTest()
 {
     _location      = new Plateau();
     _commandCenter = new CommandCenter(_location);
     _testInput     = _commandCenter.SetCommandInputs();
 }