public BetfairServerResponse <ClearedOrderSummaryReport> ListClearedOrders( BetStatus betStatus, ISet <string> eventTypeIds = null, ISet <string> eventIds = null, ISet <string> marketIds = null, ISet <RunnerId> runnerIds = null, ISet <string> betIds = null, Side?side = null, TimeRange settledDateRange = null, GroupBy?groupBy = null, bool?includeItemDescription = null, int?fromRecord = null, int?recordCount = null) { return(client.ListClearedOrders( betStatus, eventTypeIds, eventIds, marketIds, runnerIds, betIds, side, settledDateRange, groupBy, includeItemDescription, fromRecord, recordCount).Result); }
private void InitObjects() { racketWidth = Field.ActualWidth / 100; ballSize = racketWidth; racketHeight = racketWidth * 10; LeftRacket.Width = racketWidth; RightRacket.Width = racketWidth; LeftRacket.Height = racketHeight; RightRacket.Height = racketHeight; Ball.Width = racketWidth; Ball.Height = racketWidth; Canvas.SetLeft(LeftRacket, racketWidth); Canvas.SetTop(LeftRacket, Field.ActualHeight / 2 - racketHeight / 2); Canvas.SetLeft(RightRacket, Field.ActualWidth - racketWidth * 2); Canvas.SetTop(RightRacket, Field.ActualHeight / 2 - racketHeight / 2); if (lastFailedSide == null) { lastFailedSide = random.Next(0, 2) == 0 ? Side.Left : Side.Right; } if (lastFailedSide == Side.Left) { Canvas.SetLeft(Ball, ballSize * 2); } else { Canvas.SetLeft(Ball, Field.ActualWidth - ballSize * 3); } Canvas.SetTop(Ball, Field.ActualHeight / 2 - ballSize / 2); }
public Task <BetfairServerResponse <ClearedOrderSummaryReport> > ListClearedOrders( BetStatus betStatus, ISet <string> eventTypeIds = null, ISet <string> eventIds = null, ISet <string> marketIds = null, ISet <RunnerId> runnerIds = null, ISet <string> betIds = null, Side?side = null, TimeRange settledDateRange = null, GroupBy?groupBy = null, bool?includeItemDescription = null, int?fromRecord = null, int?recordCount = null) { var args = new Dictionary <string, object> { [BET_STATUS] = betStatus, [EVENT_TYPE_IDS] = eventTypeIds, [EVENT_IDS] = eventIds, [MARKET_IDS] = marketIds, [RUNNER_IDS] = runnerIds, [BET_IDS] = betIds, [SIDE] = side, [SETTLED_DATE_RANGE] = settledDateRange, [GROUP_BY] = groupBy, [INCLUDE_ITEM_DESCRIPTION] = includeItemDescription, [FROM_RECORD] = fromRecord, [RECORD_COUNT] = recordCount }; return(networkClient.Invoke <ClearedOrderSummaryReport>(Endpoint.Betting, LIST_CLEARED_ORDERS_METHOD, args)); }
/// <summary> /// The method of setting the left node in place of the removed one /// and setting the left in place of the right /// </summary> /// <param name="node">Node</param> /// <param name="currentNodeSide">Location of the node relative to the parent</param> private void RightToUp_LeftToRight(BinaryTreeNode <T, U> node, Side?currentNodeSide) { switch (currentNodeSide) { case Side.Left: node.ParentNode.LeftNode = node.RightNode; node.RightNode.ParentNode = node.ParentNode; Add(node.LeftNode, node.RightNode); break; case Side.Right: node.ParentNode.RightNode = node.RightNode; node.RightNode.ParentNode = node.ParentNode; Add(node.LeftNode, node.RightNode); break; default: var bufLeft = node.LeftNode; var bufRightLeft = node.RightNode.LeftNode; var bufRightRight = node.RightNode.RightNode; node.Key = node.RightNode.Key; node.RightNode = bufRightRight; node.LeftNode = bufRightLeft; Add(bufLeft, node); break; } }
public void MergeWith(Order otherOrder) { if (otherOrder.SausageKind.HasValue) { SausageKind = otherOrder.SausageKind; } if (otherOrder.CutKind.HasValue) { CutKind = otherOrder.CutKind; } if (otherOrder.Sauce.HasValue) { Sauce = otherOrder.Sauce; } if (otherOrder.SauceTaste.HasValue) { SauceTaste = otherOrder.SauceTaste; } if (otherOrder.SaucePosition.HasValue) { SaucePosition = otherOrder.SaucePosition; } if (otherOrder.BreadKind.HasValue) { BreadKind = otherOrder.BreadKind; } if (otherOrder.Side.HasValue) { Side = otherOrder.Side; } }
///<summary> /// Retrieves the MountingSide field</summary> /// <returns>Returns nullable Side enum representing the MountingSide field</returns> public Side?GetMountingSide() { object obj = GetFieldValue(56, 0, Fit.SubfieldIndexMainField); Side? value = obj == null ? (Side?)null : (Side)obj; return(value); }
public TileUpdateResult?Update(TileUpdateApi api) { Side?wantedMovement = null; bool?wantToGoStale = null; if (!api.TileExistsAt(Side.South)) { wantedMovement = Side.South; } else { var randomBool = UnityEngine.Random.value > 0.5f; var randomCornerSide1 = randomBool ? Side.SouthWest : Side.SouthEast; var randomCornerSide2 = randomBool ? Side.SouthEast : Side.SouthWest; if (!api.TileExistsAt(randomCornerSide1)) { wantedMovement = randomCornerSide1; } else if (!api.TileExistsAt(randomCornerSide2)) { wantedMovement = randomCornerSide2; } else { wantToGoStale = true; } } return(new TileUpdateResult { WantedMovement = wantedMovement, WantToGoStale = wantToGoStale }); }
VectorMyInt add_path(VectorMyInt start, int length, bool is_main) { Side? detect = at_border(start); VectorMyInt apos = start; bool enough = true; int i = 0; do { i++; Side step = detect.HasValue ? opposite(detect.Value) : RandomSide(apos); // if (step == start_side && Random.Range(0, 2) == 0) // continue; if (is_main && step == start_side && Random.Range(0, 100) < TENSION) { continue; } one_step(ref apos, step); apply(apos); detect = at_border(apos); if (is_main) { enough = detect.HasValue && (detect != start_side); } else { enough = i > length; } }while(!enough); return(apos); }
private HalfEdge Init(Edge edge, Side?lr) { Edge = edge; LeftRight = lr; NextInPriorityQueue = null; Vertex = null; return(this); }
public static Halfedge Create(Edge edge, Side?lr) { if (_pool.Count > 0) { return(_pool.Pop().Init(edge, lr)); } return(new Halfedge(edge, lr)); }
private Halfedge Init(Edge edge, Side?lr) { this.edge = edge; leftRight = lr; nextInPriorityQueue = null; vertex = null; return(this); }
public HalfEdge Init(Edge edge, Side?side) { Edge = edge; LeftOrRight = side; NextInPriorityQueue = null; Vertex = null; return(this); }
public HalfEdge Init(Edge edge, Side? side) { Edge = edge; LeftOrRight = side; NextInPriorityQueue = null; Vertex = null; return this; }
/// <summary> /// Removes and destroys replay objects that don't exist in the current frame /// </summary> private void RemoveReplayObjects() { int AIid = GameController.SideAIs[GameController.Side]; List <GameObject> visibleEnemies = CurrentFrame[AIid].GetProperty <RecordableState.ExtendedAI>().VisibleEnemies; Dictionary <GameObject, Vector3> lastPosition = CurrentFrame[AIid].GetProperty <RecordableState.ExtendedAI>().LastEnemyPositions; // destroy objects that dont exist in the frame and add their id to a list List <int> replayRefsToRemove = new List <int>(); foreach (KeyValuePair <int, GameObject> pair in ReplayRefs) { int id = pair.Key; bool isVisible = visibleEnemies.Contains(GameController.RecordableRefs[id]); if (CurrentFrame.ContainsKey(id)) { RecordableState.RecordableState state = CurrentFrame[id]; Side?side = null; if (state.GetProperty <RecordableState.BaseAI>() != null) { side = state.GetProperty <RecordableState.BaseAI>().Side; } RecordableState.OperatorState operatorState = state.GetProperty <RecordableState.OperatorState>(); if ((side != null && side != GameController.Side && !isVisible) || (side == GameController.Side && !operatorState.IsAlive)) { GameObject obj = pair.Value; Destroy(obj); replayRefsToRemove.Add(id); } } else { GameObject obj = pair.Value; Destroy(obj); replayRefsToRemove.Add(id); } } // using the created list remove all elements from replayRefs that point to a null object foreach (int id in replayRefsToRemove) { ReplayRefs.Remove(id); } /*List<int> removeFromMarkers = new List<int>(); * foreach (KeyValuePair<int, GameObject> pair in Markers) { * int id = pair.Key; * if (!lastPosition.ContainsKey(GameController.RecordableRefs[id])) { * removeFromMarkers.Add(id); * } * } * * foreach (int id in removeFromMarkers) { * Destroy(Markers[id]); * Markers.Remove(id); * }*/ }
public void ReallyDispose() { EdgeListLeftNeighbor = null; EdgeListRightNeighbor = null; NextInPriorityQueue = null; Edge = null; LeftOrRight = null; Vertex = null; pool.Push(this); }
private void Sum(BinaryTreeNode <T> startNode, Side?side = null) { if (startNode != null) { sum += int.Parse(startNode.Data.ToString()); //рекурсивний виклик для лівої та правої гілок Sum(startNode.LeftNode, Side.Left); Sum(startNode.RightNode, Side.Right); } }
public void Dispose() { if (edgeListLeftNeighbor == null && edgeListRightNeighbor == null && nextInPriorityQueue == null) { edge = null; leftRight = null; vertex = null; _pool.Push(this); } }
public void ReallyDispose() { edgeListLeftNeighbor = null; edgeListRightNeighbor = null; nextInPriorityQueue = null; edge = null; leftRight = null; vertex = null; _pool.Push(this); }
/// <summary> /// Delete node tree /// </summary> /// <param name="node">Node for delete</param> public void Remove(BinaryTreeNode <T, U> node) { if (node == null) { return; } Side?currentNodeSide = node.NodeSide(); // if node haven't childrens if (node.LeftNode == null && node.RightNode == null) { if (currentNodeSide == Side.Left) { node.ParentNode.LeftNode = null; } else { node.ParentNode.RightNode = null; } } // if node haven't left children, rigth -> removable node else if (node.LeftNode == null) { if (currentNodeSide == Side.Left) { node.ParentNode.LeftNode = node.RightNode; } else { node.ParentNode.RightNode = node.RightNode; } node.RightNode.ParentNode = node.ParentNode; } // if node haven't right children, left -> removable node else if (node.RightNode == null) { if (currentNodeSide == Side.Left) { node.ParentNode.LeftNode = node.LeftNode; } else { node.ParentNode.RightNode = node.LeftNode; } node.LeftNode.ParentNode = node.ParentNode; } // if node have two children, right -> removable node, left -> right node else { RightToUp_LeftToRight(node, currentNodeSide); } }
private void PrintTree(BinaryTreeNode startNode, string indent = "", Side?side = null) { if (startNode != null) { var nodeSide = side == null ? "+" : side == Side.Left ? "L" : "R"; Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Data}"); indent += new string(' ', 3); PrintTree(startNode.LeftNode, indent, Side.Left); PrintTree(startNode.RightNode, indent, Side.Right); } }
private void PrintTree(TreeNode <T> startNode, string indent = "", Side?side = null) { if (startNode != null) { var nodeSide = side == null ? "Root" : side == Side.Left ? "Left" : "Right"; Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Value}"); indent += new string(' ', 3); PrintTree(startNode.LeftNode, indent, Side.Left); PrintTree(startNode.RightNode, indent, Side.Right); } }
/// <summary> /// List fills /// </summary> /// <param name="symbol">The trading symbol</param> /// <param name="status">Order status</param> /// <param name="side">The side (buy or sell)</param> /// <param name="type">The order type</param> /// <param name="startAt">Start time</param> /// <param name="endAt">End time</param> /// <returns></returns> public async Task <IList <FuturesFillDetails> > ListFills(string symbol = null, FuturesOrderStatus?status = null, Side?side = null, OrderType?type = null, DateTime?startAt = null, DateTime?endAt = null) { var lp = new FuturesOrderListParams(status, symbol, side, type, startAt, endAt); return(await ListFills(lp)); }
private void PrintTree(TreeNode <T> startNode, string indent = "", Side?side = null) { if (startNode != null) { var nodeSide = side == null ? "+" : side == Side.Left ? "L" : "R"; Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Data}"); indent += new string(' ', 3); //рекурсивный вызов для левой и правой веток PrintTree(startNode.LeftNode, indent, Side.Left); PrintTree(startNode.RightNode, indent, Side.Right); } }
private void PrintTree(BinaryTreeNode <T> startNode, List <T> all, Side?side = null) { if (startNode != null) { var nodeSide = side == null ? "+" : side == Side.Left ? "L" : "R"; all.Add(startNode.Data); //Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Data}"); //рекурсивный вызов для левой и правой веток PrintTree(startNode.LeftNode, all, Side.Left); PrintTree(startNode.RightNode, all, Side.Right); } }
/// <summary> /// Вивід бінарного дерева починаючи з вказаного вузла /// </summary> /// <param name="startNode">Вузол з якого розпочинається друк дерева</param> /// <param name="indent">Відступ</param> /// <param name="side">Сторона</param> private void PrintTree(BinaryTreeNode <T> startNode, string indent = "", Side?side = null) { if (startNode != null) { var nodeSide = side == null ? "+" : side == Side.Left ? "L" : "R"; Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Data}"); indent += new string(' ', 3); //рекурсивний виклик для лівої та правої гілок PrintTree(startNode.LeftNode, indent, Side.Left); PrintTree(startNode.RightNode, indent, Side.Right); } }
public static Vertex Intersect(Halfedge halfedge0, Halfedge halfedge1) { Edge edge = halfedge0.edge; Edge edge2 = halfedge1.edge; if (edge == null || edge2 == null) { return(null); } if (edge.rightSite == edge2.rightSite) { return(null); } float num = edge.a * edge2.b - edge.b * edge2.a; if (-1E-10 < (double)num && (double)num < 1E-10) { return(null); } float num2 = (edge.c * edge2.b - edge2.c * edge.b) / num; float y = (edge2.c * edge.a - edge.c * edge2.a) / num; Halfedge halfedge2; Edge edge3; if (Voronoi.CompareByYThenX(edge.rightSite, edge2.rightSite) < 0) { halfedge2 = halfedge0; edge3 = edge; } else { halfedge2 = halfedge1; edge3 = edge2; } bool flag = num2 >= edge3.rightSite.x; if (flag) { Side?leftRight = halfedge2.leftRight; if (leftRight.GetValueOrDefault() == Side.LEFT && leftRight.HasValue) { goto IL_0138; } } if (flag || halfedge2.leftRight != Side.RIGHT) { return(Create(num2, y)); } goto IL_0138; IL_0138: return(null); }
public void Dispose() { if (EdgeListLeftNeighbor != null || EdgeListRightNeighbor != null) return; if (NextInPriorityQueue != null) return; Edge = null; LeftOrRight = null; Vertex = null; pool.Push(this); }
public async Task <IList <Fill> > ListFills( string symbol = null, Side?side = null, OrderType?type = null, TradeType?tradeType = null, DateTime?startAt = null, DateTime?endAt = null ) { var lp = new OrderListParams(null, symbol, side, type, tradeType, startAt, endAt); return(await ListFills(lp)); }
private Site FortunesAlgorithm_rightRegion(Halfedge he) { Edge edge = he.edge; if (edge == null) { return(fortunesAlgorithm_bottomMostSite); } Edge edge2 = edge; Side?leftRight = he.leftRight; return(edge2.Site(SideHelper.Other(leftRight.Value))); }
public async Task <IList <OrderDetails> > ListOrders( OrderStatus?status = null, string symbol = null, Side?side = null, OrderType?type = null, TradeType?tradeType = null, DateTime?startAt = null, DateTime?endAt = null ) { var lp = new OrderListParams(status, symbol, side, type, tradeType, startAt, endAt); return(await ListOrders(lp)); }
public void PrintTree(BinaryTreeNode startNode, string indent = "", Side?side = null) { if (startNode != null) { //определяем сторону var nodeSide = side == null ? "+" : side == Side.Left ? "L" : "R"; //выводим Console.WriteLine($"{indent} [{nodeSide}]- {startNode.Data}"); //добавляем отступ indent += new string(' ', 3); //рекурсивный вызов для левой и правой веток PrintTree(startNode.LeftNode, indent, Side.Left); PrintTree(startNode.RightNode, indent, Side.Right); } }
// TODO: Nullable (and all connections). string GetSideFilepath(Side? side) { if (side == Side.Left) { return controller.inspectingDuplicate.File1Path; } else if (side == Side.Right) { return controller.inspectingDuplicate.File2Path; } else { return null; } }
public bool StartLerp(Cell source, Cell dest, float speed, Side? s = null) { bool available = dest.Reserve() && dest != null; if (available) { isMoving = true; StartPos = source.WorldPos(); destination = dest; tempSpeed = speed; currentLerp = 0f; currentRot = transform.eulerAngles; targetRot = s; } return available; }