public override string ToString() { var final = new StringBuilder(); final.Append($"{Name.PadRight(30)} | "); final.Append($"{Played.ToString().PadLeft(2)} | "); final.Append($"{Won.ToString().PadLeft(2)} | "); final.Append($"{Drawn.ToString().PadLeft(2)} | "); final.Append($"{Lost.ToString().PadLeft(2)} | "); final.Append($"{Point.ToString().PadLeft(2)}"); return(final.ToString()); }
public string[] getinfo() { string[] info = new string[9]; info[0] = TeamName; info[1] = Played.ToString(); info[2] = Won.ToString(); info[3] = Drawn.ToString(); info[4] = Lost.ToString(); info[5] = GF.ToString(); info[6] = GA.ToString(); info[7] = GD.ToString(); info[8] = Points.ToString(); return(info); }
static void Main(string[] args) { //GAME STARTS HERE Console.SetWindowSize(110, 25); StishBoard.Instance.Player1 = Player.PlayerFactory(Player.PlayerNumber.Player1, Player.PlayerType.Human, StishBoard.Instance);; StishBoard.Instance.Player2 = Player.PlayerFactory(Player.PlayerNumber.Player2, Player.PlayerType.Computer, StishBoard.Instance);; Console.Clear(); StishBoard.Instance.Render(); //game loop takes place here bool GameEnd = false; Won won = 0; Turn turn = Turn.Player1; while (GameEnd == false) { //checks if a base has been destroyed. if one has then the other player has won. //if not then alternate player turns Coordinate P1Base = new Coordinate(StishBoard.Instance.Player1.BaseX, StishBoard.Instance.Player1.BaseY); Coordinate P2Base = new Coordinate(StishBoard.Instance.Player2.BaseX, StishBoard.Instance.Player2.BaseY); if (StishBoard.Instance.getSquare(P2Base).Dep.Health < 1) { //Player1 has won GameEnd = true; won = Won.Player1; } else if (StishBoard.Instance.getSquare(P1Base).Dep.Health < 1) { //Player2 has won GameEnd = true; won = Won.Player2; } else { //Game Continues if (turn == Turn.Player1) { Cursor.Instance.FindX = StishBoard.Instance.Player1.CursorX; Cursor.Instance.FindY = StishBoard.Instance.Player1.CursorY; StishBoard.Instance.Player1.TurnBalance(StishBoard.Instance); StishBoard.Instance.Player1.MaxMP(StishBoard.Instance); Analytics.Cardinal(StishBoard.Instance.Player1, Cursor.Instance.Where); StishBoard.Instance.Player1.MakeMove(); turn++; } else if (turn == Turn.Player2) { Cursor.Instance.FindX = StishBoard.Instance.Player2.CursorX; Cursor.Instance.FindY = StishBoard.Instance.Player2.CursorY; StishBoard.Instance.Player2.TurnBalance(StishBoard.Instance); StishBoard.Instance.Player2.MaxMP(StishBoard.Instance); Analytics.Cardinal(StishBoard.Instance.Player2, Cursor.Instance.Where); StishBoard.Instance.Player2.MakeMove(); turn--; } } } Console.WriteLine("{0} HAS WON THE GAME \nPRESS <ENTER> TO KILL THE PROGRAM", won.ToString()); Console.ReadLine(); }