public GameRunner(IIOHandler ioHandler, int deltaMs)
 {
     CommandBindings = new Dictionary <string, Type>();
     Systems         = new List <ISharperSystem <BaseSharperComponent> >();
     IOHandler       = ioHandler;
     Entities        = new List <SharperEntity>();
     DeltaMs         = deltaMs;
 }
        public void SetUp()
        {
            _ioHandler = Substitute.For <IIOHandler>();

            var tuple = ("test", new List <string>(), (IUniverseCommandSource) new TestCommandSource(0));

            _ioHandler.GetInputAsync().Returns(Task.FromResult(tuple));
            _ioHandler.SendOutputAsync(Arg.Any <string>()).Returns(Task.CompletedTask);
        }
Beispiel #3
0
        public UIHandler(IArgumentHandler argumentHandler, IIOHandler ioHandler, INetworkCommunicationHandler networkCommunicationHandler, IHTTPOutputInterpreter httpOutputInterpreter)
        {
            this._argumentHandler             = argumentHandler;
            this._ioHandler                   = ioHandler;
            this._networkCommunicationHandler = networkCommunicationHandler;
            this._httpOutputInterpreter       = httpOutputInterpreter;

            this._filterCriterias = argumentHandler.FilterCriterias.ToList();
        }
 /// <summary>
 /// Add a <see cref="IIOHandler"/> to the <see cref="GameRunner"/>.
 /// </summary>
 /// <typeparam name="handler">The <see cref="IIOHandler"/> to add as the input/output handler for this <see cref="GameRunner"/>.</typeparam>
 /// <returns>A <see cref="SystemBuilder"/>, for building the next phase of the Sharper Universe.</returns>
 public SystemBuilder AddIOHandler(IIOHandler handler)
 {
     _game.IOHandler = handler;
     return(new SystemBuilder(_game));
 }
Beispiel #5
0
 public ChangeCalculator(IIOHandler ioHandler, ICalculateChange minCalculator, ICalculateChange randomCalculator)
 {
     _ioHandler        = ioHandler;
     _minCalculator    = minCalculator;
     _randomCalculator = randomCalculator;
 }
 public void TearDown()
 {
     _ioHandler = null;
 }
Beispiel #7
0
 public Engine(IIOHandler iOHandler, ICellFactory cellFactory)
 {
     this.iOHandler   = iOHandler;
     this.cellFactory = cellFactory;
 }
 private void InitializeCommandRequirements(IIOHandler ioHandler, RoundSystem roundSystem, PlayerSystem playerSystem)
 {
     _ioHandler    = ioHandler;
     _roundSystem  = roundSystem;
     _playerSystem = playerSystem;
 }
 private void InitializeCommandRequirements(IIOHandler ioHandler)
 {
     _ioHandler = ioHandler;
 }