public List <Trade> GetTrades(ESymbol symbol) { var request = new RestRequest($"public/trades/{symbol.ToString()}", Method.GET); IRestResponse response = client.Execute(request); var content = response.Content; return(JsonConvert.DeserializeObject <List <Trade> >(content)); }
public Orderbook GetOrderbook(ESymbol symbol) { var request = new RestRequest($"public/orderbook/{symbol.ToString()}", Method.GET); IRestResponse response = client.Execute(request); var content = response.Content; return(JsonConvert.DeserializeObject <Orderbook>(content)); }
public Ticker GetTicker(ESymbol symbol) { var request = new RestRequest($"public/ticker/{symbol.ToString()}", Method.GET); IRestResponse response = client.Execute(request); var content = response.Content; return(JsonConvert.DeserializeObject <Ticker>(content)); }
public static string Symbol2String(ESymbol symbol) { switch (symbol) { case ESymbol.None: return(" "); case ESymbol.Cross: return("X"); case ESymbol.Circle: return("O"); default: throw new NotSupportedException(); } }
public void Fill(JsonCheckStatusResponse data, ESymbol mySymbol, bool isMyTurn) { foreach (var p in data.coordinates) { PointData pd = new PointData() { X = p.x, Y = p.y }; if (p.playerId == data.playerCircleId) { CirclePoints.Add(pd); } if (p.playerId == data.playerCrossId) { CrossPoints.Add(pd); } } MySymbol = mySymbol; IsMyTurn = isMyTurn; }
public bool DoesPlayerWins(ESymbol playerSymbol) { var winningPossibilities = new List <int[]> { new[] { 1, 2, 3 }, new[] { 4, 5, 6 }, new[] { 7, 8, 9 }, new[] { 1, 4, 7 }, new[] { 2, 5, 8 }, new[] { 3, 6, 9 }, new[] { 1, 5, 9 }, new[] { 7, 5, 3 }, }; foreach (var possibility in winningPossibilities) { var won = true; foreach (var posItem in possibility) { //zero based var i = posItem - 1; if (_board[i] == ESymbol.None || _board[i] != playerSymbol) { won = false; } } if (won) { return(true); } } return(false); }
public void drawChar(int posX, int posY, ESymbol symbol) { }
public Tree(char Node, ESymbol Type) { this.Node = Node; this.Type = Type; }