private void DisplayAttackMenu() { KeyBindsGenerator keyBindsGenerator = new KeyBindsGenerator(); keyBindsGenerator.GenerateKeyBindsForEvent(GameEvent.PopMenu, "attack"); keyBindsGenerator.CompleteEvent(); }
public void DisplayMenu() { KeyBindsGenerator keyBindsGenerator = new KeyBindsGenerator(); keyBindsGenerator.GenerateKeyBindsForEvent(GameEvent.PopMenu, "character"); keyBindsGenerator.CompleteEvent(); }
public void Initialize() { //Arrange testCrowdMember = new Mock <CrowdMember>().Object; keyBindsGenerator = new Mock <KeyBindsGenerator>().Object; testCrowdMember.Name = "Statesman"; testCrowdMember.ActiveIdentity = new Identity("model_Statesman", IdentityType.Model); }
/// <param name="surface">Represents the name of the model or the costume to load</param> /// <param name="type">The type of the identity, it can be either a Model or a Costume</param> /// <param name="name">The name to be displayed for this identity</param> public Identity(string surface, IdentityType type, string name = null) { Type = type; Surface = surface; this.Name = name == null ? surface : name; //isDefault = false; //isActive = false; this.keyBindsGenerator = new KeyBindsGenerator(); }
public void GenerateKeyBindsForEvent_PlacesKeybindInTempBindFile() { // THIS CANNOT POSSIBLY BE TESTED WITH MOCK AS IT CONTAINS ACTUAL FILE I/O. WE SHOULD USE AN ACTUAL INSTANCE OF KeyBindsGenerator keyBindsGenerator = new KeyBindsGenerator(); //Act keyBindsGenerator.GenerateKeyBindsForEvent(GameEvent.SpawnNpc, testCrowdMember.ActiveIdentity.Surface, testCrowdMember.Name); keyBindsGenerator.CompleteEvent(); StreamReader actualFile = new StreamReader(keyBindsGenerator.BindFile); string actual = actualFile.ReadLine(); actualFile.Close(); //Assert string valid = string.Format("{2} \"spawn_npc {0} {1}\"", testCrowdMember.ActiveIdentity.Surface, testCrowdMember.Name, keyBindsGenerator.TriggerKey); Assert.AreEqual(valid, actual); keyBindsGenerator = new Mock <KeyBindsGenerator>().Object; }