public Command InterpretRequest(string command) { Command interpretation; if (command.Equals(TextCommands.REGISTER, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandRegister(); } else if (command.Equals(TextCommands.LOGIN, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandLogin(); } else if (command.Equals(TextCommands.LOGOUT, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandLogOut(); } else if (command.Equals(TextCommands.JOINMATCH, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandJoin(); } else if (command.Equals(TextCommands.SELECTCHARACTER, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandSelect(); } else if (command.Equals(TextCommands.MOVE, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandMove(); } else if (command.Equals(TextCommands.ATTACK, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandAttack(); } else if (command.Equals(TextCommands.EXIT, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandExit(); } else { interpretation = new CommandUnknown(); } return(interpretation); }
void Start() { command = new CommandManager(); command.SetCommand("Left", KeyCode.LeftArrow); command.SetCommand("Right", KeyCode.RightArrow); command.SetCommand("Jump", KeyCode.Z); command.SetCommand("Attack", KeyCode.X); Debug.Log("조작키 Left :" + command.GetCommand("Left")); cmd_Left = new CommandLeft(); cmd_Right = new CommandRight(); cmd_Jump = new CommandJump(); cmd_JumpHold = new CommandJumpHold(); cmd_Attack = new CommandAttack(); bulletFactory.Init(); faceDir = 1; }
public void SetCommand() { if (bCmd == true) { btnA = new CommandAttack(this, shield, cannon, firePos); btnB = new CommandDefense(this, shield, cannon, firePos); bCmd = false; txt1.text = "A - Attack"; txt2.text = "B - Defense"; } else { btnA = new CommandDefense(this, shield, cannon, firePos); btnB = new CommandAttack(this, shield, cannon, firePos); bCmd = true; txt1.text = "A - Defense"; txt2.text = "B - Attack"; } }
/// <summary> /// NOTE : COMMAND 설저 /// </summary> private void SetCommand() { moveC = new CommandMove(); jumpC = new CommandJump(); attackC = new CommandAttack(); }