public bool Login(string robotId) { var reader = new RobotReader(); Robot robot = reader.GetRobotInfo(robotId); return(robot != null); }
public RobotStrategy Get(string robotId) { var reader = new RobotReader(); Robot robot = reader.GetRobotInfo(robotId); return(robot.RobotStrategy); }
public void Remove(string robotId) { var reader = new RobotReader(); Robot robot = reader.GetRobotInfo(robotId); robot.RobotStrategy.Strategy.RemoveAt(robot.RobotStrategy.Strategy.Count - 1); var writer = new StrategyWriter(); writer.UpdateStrategy(robot.RobotId, robot.RobotStrategy); }
public void Update(string robotId, Action action, ActionStrength level) { var reader = new RobotReader(); Robot robot = reader.GetRobotInfo(robotId); robot.RobotStrategy.Strategy.Add(new RobotTurn { Action = action, Level = level }); var writer = new StrategyWriter(); writer.UpdateStrategy(robot.RobotId, robot.RobotStrategy); }
public void RegisterRobot(string robotId, PlayType playType) { var reader = new RobotReader(); Robot robot = reader.GetRobotInfo(robotId); robot.PlayType = playType; robot.Status = new RobotStatus(); Robots.Add(robot); if (Robots.Count == BattleFieldCapacity) { SetRobotsEnemies(); } robot.Ready = true; }