public GameEngine(IDisplay display, ICollector collector, IInputProcessor processor, Game game) { _display = display; _collector = collector; _processor = processor; _game = game; }
public GameEngine(IInputProcessor inputProcessor, IConsoleDisplayService consoleDisplayService, IMessageFormatter messageFormatter) { _inputProcessor = inputProcessor; _consoleDisplayService = consoleDisplayService; _messageFormatter = messageFormatter; }
public void AddInputProcessor(IInputProcessor processor) { if (processor == null) throw new ArgumentNullException("processor"); Processors.Add(processor); }
public ConferenceTrackManager(IDisplay display, IInputCollector inputCollector, IInputProvider inputProvider, IInputProcessor inputProcessor, TrackGenerator trackGenerator) { _display = display; _inputCollector = inputCollector; _inputProvider = inputProvider; _inputProcessor = inputProcessor; _trackGenerator = trackGenerator; }
public Game(Player player, IDisplay display, IInputCollector inputCollector, IInputProcessor inputProcessor, Dictionary <Validators, IInputValidator> inputValidators) { _inputValidators = inputValidators; _inputProcessor = inputProcessor; _display = display; _inputCollector = inputCollector; _player = player; }
public void AddInputProcessor(IInputProcessor processor) { if (processor == null) { throw new ArgumentNullException("processor"); } Processors.Add(processor); }
public Engine( IInputProcessor inputProcessor, IReader reader, IWriter writer) { this.processor = inputProcessor; this.reader = reader; this.writer = writer; }
public void StartAllHandlers() { this.attackServiceHandler = new AttackServiceHandler(this); this.pluginHandler = new PluginHandler(this); this.tabPageHandler = new TabPageHandler(this.tc_Plugins, this); this.inputProcessorHandler = new HandlerNamedPipe(this); // this.inputProcessorHandler = new HandlerMessageQueue(this); this.nicHandler = new NetworkInterfaceHandler(this); this.caCertificateHandler = new ManageServerCertificates(this); this.macVendorHandler = new MacVendorHandler(); this.minaryProcessHandler = new MinaryProcess(); }
public InputProcessorHandlesInvalidCommand() { _inputProcessor = GivenTheInputProcessorUsingAFileWithAnInvalidCommand(); try { WhenTheInputIsProcessed(); } catch (Exception e) { _exception = e; } }
public void Remove(TValue value) { if (EqualityComparer <TValue> .Default.Equals(firstValue, value)) { if (additionalValues != null) { firstValue = additionalValues[0]; if (additionalValues.Length == 1) { additionalValues = null; } else { Array.Copy(additionalValues, 1, additionalValues, 0, additionalValues.Length - 1); Array.Resize(ref additionalValues, additionalValues.Length - 1); } } else { firstValue = default(TValue); } } else if (additionalValues != null) { var numAdditionalProcessors = additionalValues.Length; for (var i = 0; i < numAdditionalProcessors; ++i) { if (EqualityComparer <TValue> .Default.Equals(additionalValues[i], value)) { if (i == numAdditionalProcessors - 1) { Array.Resize(ref additionalValues, numAdditionalProcessors - 1); } else { var newAdditionalProcessors = new IInputProcessor <TValue> [numAdditionalProcessors - 1]; if (i > 0) { Array.Copy(additionalValues, 0, newAdditionalProcessors, 0, i); } Array.Copy(additionalValues, i + 1, newAdditionalProcessors, i, numAdditionalProcessors - i); } break; } } } }
public static IInputProcessor Create(string fileName) { XmlDocument xml = new XmlDocument(); xml.Load(fileName); foreach (var format in GetFormats()) { if (format.Test(xml)) { IInputProcessor processor = format.Processor; processor.SetDocument(xml); return(processor); } } throw new Exception(String.Format("Failed to determine processor for {0}", fileName)); }
public ListeningService( ITelegramBotClientWrapper telegramClientWrapper , ILogger <ListeningService> logger , ICommandProcessor commandProcessor , IUserStorage userCache , IOptions <ListeningServiceAppSettings> appSettings , IMonitoringManager monitoringManager , IMapper mapper , IEventManager eventManager , IInputProcessor inputProcessor ) { _botClient = telegramClientWrapper.Client; _logger = logger; _commandProcessor = commandProcessor; _userStorage = userCache; _appSettings = appSettings.Value; _monitoringManager = monitoringManager; _mapper = mapper; _eventManager = eventManager; _inputProcessor = inputProcessor; }
private void Start() { _type = AutomataManager.automataType; _inputField = GetComponent <InputField>(); _inputRect = GetComponent <RectTransform>(); _size = _inputRect.sizeDelta; _inputRect.localScale = Vector3.one; if (_inputCheck == null) { if (_type == AutomataType.dfa) { _inputCheck = new SingleTagProcessor(); } else if (_type == AutomataType.DPDA || _type == AutomataType.Turing) { _inputCheck = new TripletTagProcessor(); } } gameObject.SetActive(false); ConnectionEvents.Instance.OnEditMode += OnActiveEditMode; BuildStateEvents.Instance.OnDeleteState += DestroyThisWhenStateDeleted; }
public InputProcessorHandlesGetRelationshipWithUnknownPerson() { _inputProcessor = GivenTheInputProcessorQueryingWithAnUnknownPerson(); WhenTheInputIsProcessed(); }
/// <summary> /// Adds a new input source /// </summary> /// <param name="processor">The input processor to add</param> public void Add(IInputProcessor processor) { _processors.Add(processor); }
public void DeactivateInput() { InputProcessor = null; }
public void ActivateInput(IInputProcessor inputProcessor) { InputProcessor = inputProcessor; }
public InputProcessorHandlesAddChildWithUnknownMother() { _inputProcessor = GivenTheInputProcessorQueryingWithAnUnknownPerson(); WhenTheInputIsProcessed(); }
/// <summary> /// Initializes a new instance of the <see cref="T9Mediator"/> class. /// </summary> /// <param name="countInput"> /// The count input. /// </param> /// <param name="messagesInput"> /// The messages input. /// </param> /// <param name="mapper"> /// The mapper. /// </param> public T9Mediator(IInputProcessor <string, uint> countInput, IInputProcessor <string, string> messagesInput, IT9Mapper mapper) { this.CountInput = countInput; this.MessagesInput = messagesInput; this.Mapper = mapper; }
public Engine(IReader reader, IWriter writer, IInputProcessor processor) { this.reader = reader ?? throw new ArgumentNullException(nameof(reader)); this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); this.processor = processor ?? throw new ArgumentNullException(nameof(processor)); }
/// <summary> /// Removes the specified processor /// </summary> /// <param name="processor">The input processor to remove</param> public void Remove(IInputProcessor processor) { _processors.Remove(processor); }
public InputProcessorHandlesGetRelationshipCommand() { _inputProcessor = GivenTheInputProcessorUsingAFileWithAGetRelationshipCommand(); WhenTheInputIsProcessed(); }
static void Main(string[] args) { _inputProcessor = new DoomInputProcessor(new DoomHttpClient()); _inputProcessor.Start(); /*Console.WriteLine("Weaponizing Demons, for a Brighter Tomorrow!\n"); * * //////////////////////// * // HTTP Client creates Endpoint Services * ; * * //var doors = doomClient.WorldService.GetDoors(); * //List<Door> doorsList = doors.Result; * * //foreach (Door door in doorsList) * //{ * // Console.WriteLine("Opening door " + door.id); * // doomClient.WorldService.OpenDoor(door.id.ToString()); * //} * //////////////////////////// * // Testing API * //var player = doomClient.PlayerService.GetPlayerStatus(); * //Console.WriteLine("Player Health: " + player.Result.health); * //Console.WriteLine("Coordinates: (" + player.Result.position.x + "," + player.Result.position.y + "," + player.Result.position.z + ")"); * * //var world = doomClient.WorldService.GetWorldStatus(); * //Console.WriteLine("Level: " + world.Result.episode); * * //var doors = doomClient.WorldService.GetDoors(); * //List<Door> doorsList = doors.Result; * //foreach (Door obj in doorsList) * //{ * // Console.WriteLine("Door " + obj.id + " is " + obj.state); * //} * * //var worldObjects = doomClient.WorldService.GetWorldObjects(); * ////List<WorldObject> worldObjectsList = worldObjects.Result; * ////foreach(WorldObject obj in worldObjectsList) { * // //Console.WriteLine("Found Object: " + obj.type); * ////} * * //Player.Player updatedPlayer = new Player.Player(); * * //updatedPlayer.health = 500; * * //var response = doomClient.PlayerService.UpdatePlayer(updatedPlayer); * //Console.WriteLine("Updated Player: " + response.Result.ToString()); * * //var response1 = doomClient.PlayerService.PerformPlayerAction(Player.Action.shoot); * //Console.WriteLine("BANG!"); * //var response2 = doomClient.PlayerService.PerformPlayerAction(Player.Action.shoot); * //Console.WriteLine("BANG!"); * //var response3 = doomClient.PlayerService.PerformPlayerAction(Player.Action.shoot); * //Console.WriteLine("BANG!"); * * //Console.WriteLine("Coordinates: (" + player.Result.position.x.ToString() + "," + player.Result.position.y.ToString() + "," + player.Result.position.z.ToString()+ ")"); * ////var response4 = doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); * ////doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); * * * //Console.WriteLine("Coordinates: (" + player.Result.position.x.ToString() + "," + player.Result.position.y.ToString() + "," + player.Result.position.z.ToString()+ ")"); * ////var response5 = doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); * ////var response6 = doomClient.PlayerService.PerformPlayerAction(Player.Action.forward); * ////var response7 = doomClient.PlayerService.PerformPlayerAction(Player.Action.forward); * ////var response8 = doomClient.PlayerService.PerformPlayerAction(Player.Action.forward); * ////var response9 = doomClient.PlayerService.PerformPlayerAction(Player.Action.forward); * ////Console.WriteLine("RUN AWAY!!"); * * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * //Program.turnRightTestNoWait(doomClient); * * * * // TODO Add PATCH command for opening Doors, will probably open all doors at the beginning * // There is a big scary monster man in the last door though, opening that too early * // may be a problem * * // * /////////////////////////////// * * } * * //public async System.Threading.Tasks.Task OpenAllDoorsAsync() * //{ * // var doors = DoomHttpClient.WorldService.GetDoors(); * // List<Door> doorsList = doors.Result; * * <<<<<<< HEAD * // * ///////////////////////////////*/ // foreach (Door door in doorsList) // { // Console.WriteLine("Opening door " + door.id); // await _httpClient.WorldService.OpenDoor(door.id.ToString()); // } //} /*public static async void turnRightTestNoWait(DoomHttpClient doomClient) * { * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * } * * public static async void turnRightTestWait(DoomHttpClient doomClient) * { * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * System.Threading.Thread.Sleep(800); * await doomClient.PlayerService.PerformPlayerAction(Player.Action.turn_right); Console.WriteLine("BANG!"); * }*/ }
public ClassUnderTest(IInputProcessor inputProcessor) { this.inputProcessor = inputProcessor; }
public InputProcessorHandlesAddChildCommand() { _inputProcessor = GivenTheInputProcessorUsingAFileWithAGetChildCommand(); WhenTheInputIsProcessed(); }
/// <inheritdoc /> public IT9Mediator CreateMediator(IInputProcessor <string, uint> countProcessor, IInputProcessor <string, string> messageProcessor, IT9Mapper mapper) { return(new T9Mediator(countProcessor, messageProcessor, mapper)); }
public void AddInputProcessor(IInputProcessor inputProcessor) => subscribers.Add(inputProcessor);
public void SetUp() { _converter = new NumberConverter(); _inputValidator = new InputValidator(); _inputProcessor = new InputProcessor(_converter, _inputValidator); }
public InputProcessorHandlesGetSisterInLaw() { _inputProcessor = GivenTheInputProcessorUsingAFileWithAGetSisterInLawCommand(); WhenTheInputIsProcessed(); }
/// <summary> /// Adds a new input source to the front of the processors list /// </summary> /// <param name="processor">The input processor to add</param> public void AddToFront(IInputProcessor processor) { _processors.Insert(0, processor); }