private int ProcessNewSoundData(SoundData data) { if (data.GetSoundCommand().CompareTo("jump") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.JUMP; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding Jump sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("reload") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.RELOAD; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding Jump sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("knife") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.KNIFE; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding KNIFE sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("grenade") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.GRENADE; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding grenade sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("menu") == 0 || data.GetSoundCommand().CompareTo("pause") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.ESC; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding Menu/Pause sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("select") == 0 || data.GetSoundCommand().CompareTo("okay") == 0 || data.GetSoundCommand().CompareTo("enter") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.ENTER; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding select/okay/enter sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("up") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.UP_ARROW; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding up sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("down") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.DOWN_ARROW; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding down sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("right") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.RIGHT_ARROW; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding right command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } if (data.GetSoundCommand().CompareTo("left") == 0) { KeyboardInputProcessor.KeyboardData newKeyboardData = new KeyboardInputProcessor.KeyboardData(); newKeyboardData.KeyboardAction = (int)KeyboardAction.LEFT_ARROW; newKeyboardData.KeyPersistance = (int)KeyboardPersistance.PRESS_AND_RELEASE; soundLogger.Debug("Adding left sound command to the keyboard queue"); keyboardProcessor.AddToQueue(newKeyboardData); soundLogger.Debug("Successfully added"); } return (int)ResultCodes.Success; }