public GameInfo(string username, Game.PlayerColor myColor, bool gameOver = false, Game.PlayerColor winnerColor = Game.PlayerColor.None) { this.username = username; this.myColor = myColor; this.gameOver = gameOver; this.winnerColor = winnerColor; }
public ConnectedPlayer(ConnectedClient client, int id, string username, Game.PlayerColor color = Game.PlayerColor.None, int iconNumber = 0) { this.client = client; this.roomID = id; this.username = username; this.iconNumber = iconNumber; this.color = color; }
private void activateNewSetTimer(Game.PlayerColor color, float maxTime) { foreach (KeyValuePair <Game.PlayerColor, ClientUserPanelUI> storedValue in playerColorToUserPanel) { if (storedValue.Key == color) { playerColorToUserPanel [storedValue.Key].startTimer(maxTime); } else { playerColorToUserPanel [storedValue.Key].stopTimer(); } } }
public RPCMove(int move, Game.PlayerColor color) { this.move = move; this.color = color; }
private void sendString(int targetID, MsgType type, string str, Game.PlayerColor color) { sendMsg(new StringMessage(str, color), targetID, (short)type); }
//Server public void sendMove(int targetID, string move, Game.PlayerColor color) { sendString(targetID, MsgType.move, move, color); }
public static LocalPlayer getPlayerFromColor(PlayerColor color) { return(players.Find(x => x.info.color == color)); }
public static bool hasLocalPlayerOfColor(PlayerColor color) { return(players.Find(x => x.info.color == color) != null); }
public ConnectedPlayer getMatchingPlayer(PlayerColor color) { return(players.Find(x => x.color == color)); }
public void initTimer(Game.PlayerColor color, float maxTime) { playerColorToUserPanel [color].initTurnTime(maxTime); }
public void removeConnectedPlayer(Game.PlayerColor color, string username, int iconNumber) { playerColorToUserPanel [color].clearPanel(); }
public void initPlayerSlot(Game.PlayerColor color, string username, int iconNumber) { playerColorToUserPanel [color].setUserPanel(iconNumber, username); }
public override void onOutgoingLocalMsg(string msg, Game.PlayerColor color) { print("Sending server msg: " + msg + " from: " + color); }
public GameCommand(Game.PlayerColor myColor, SpeedRunnerProtocol.PlayerCommand command) { this.command = command; this.myColor = myColor; }
public abstract void onOutgoingLocalMsg(string msg, PlayerColor color);
public void startTimer(Game.PlayerColor color, float maxTime) { activateNewSetTimer(color, maxTime); }
public static int convertColorToTeam(Game.PlayerColor color) { return(color == PlayerColor.Blue ? 1 : 2); }
public StringMessage(string msg, PlayerColor color = PlayerColor.None) { this.msg = msg; this.color = color; }