protected void Setup() { _subjects = new IndexCollection <string>(); _subjects.Add(Subject1, 0, 2); _subjects.Add(Subject2, 2, 2); _subjects.Add(Subject3, 4, 2); }
protected void Setup() { _subjects = new IndexCollection<string>(); _subjects.Add(Subject1, 0, 2); _subjects.Add(Subject2, 2, 2); _subjects.Add(Subject3, 4, 2); }
/// <summary> /// Get positions by criteria /// </summary> /// <param name="inputs"></param> /// <returns></returns> protected async Task <IndexCollection <ITransactionPositionModel> > GetGenericPositions(dynamic inputs) { var positions = new IndexCollection <ITransactionPositionModel>(); var response = await GetResponse <InputDealListModel>($"/v3/accounts/{ Account.Id }/trades"); foreach (var inputOrder in response.Deals) { var positionModel = new TransactionPositionModel { Id = $"{ inputOrder.Id }", Size = inputOrder.Size, Price = inputOrder.Price, OpenPrice = inputOrder.Price, Type = OrderTypeMap.Input(inputOrder.Type), Status = DealStatusMap.Input(inputOrder.Status), TimeSpan = OrderTimeSpanMap.Input(inputOrder.TimeSpan), Time = inputOrder.OpenTime ?? inputOrder.CreationTime, DealTime = inputOrder.OpenTime }; positions.Add(positionModel); } return(positions); }
private IndexCollection CreateIndices(params int[][] pPositions) { IndexCollection indices = new IndexCollection(); int length = pPositions.Length; // positions are passed in in groups of two for (int i = 0; i < length; i++) { int hX = pPositions[i][0]; int hY = pPositions[i][1]; indices.Add(GetIndex(hX, hY)); } return(indices); }
/// <summary> /// This function reverses the order of the indices, i.e changes which direction /// this face faces in. /// </summary> /// <param name="parent">The parent polygon.</param> public void Reorder(Polygon parent) { // Create a new index collection. IndexCollection newIndices = new IndexCollection(); // Go through every old index and add it. for (int i = 0; i < indices.Count; i++) { newIndices.Add(indices[indices.Count - (i + 1)]); } // Set the new index array. indices = newIndices; // Recreate each normal. GenerateNormals(parent); }
/// <summary> /// Get orders by criteria /// </summary> /// <param name="inputs"></param> /// <returns></returns> protected async Task <IndexCollection <ITransactionOrderModel> > GetGenericOrders(dynamic inputs) { var orders = new IndexCollection <ITransactionOrderModel>(); var response = await GetResponse <InputOrderListModel>($"/v3/accounts/{ Account.Id }/orders"); foreach (var inputOrder in response.Orders) { var orderModel = new TransactionOrderModel { Id = $"{ inputOrder.Id }", Size = inputOrder.Size, Price = inputOrder.Price, Time = inputOrder.CreationTime, Type = OrderTypeMap.Input(inputOrder.Type), Status = OrderStatusMap.Input(inputOrder.Status), TimeSpan = OrderTimeSpanMap.Input(inputOrder.TimeSpan), DealTime = inputOrder.FillTime ?? inputOrder.CancellationTime ?? inputOrder.TriggerTime }; orders.Add(orderModel); } return(orders); }
private IndexCollection CreateIndices(params int[][] pPositions) { IndexCollection indices = new IndexCollection(); int length = pPositions.Length; // positions are passed in in groups of two for (int i = 0; i < length; i++) { int hX = pPositions[i][0]; int hY = pPositions[i][1]; indices.Add(GetIndex(hX, hY)); } return indices; }
/// <summary> /// This function reverses the order of the indices, i.e changes which direction /// this face faces in. /// </summary> /// <param name="parent">The parent polygon.</param> public void Reorder(Polygon parent) { // Create a new index collection. IndexCollection newIndices = new IndexCollection(); // Go through every old index and add it. for(int i = 0; i < indices.Count; i++) newIndices.Add(indices[indices.Count - (i+1)]); // Set the new index array. indices = newIndices; // Recreate each normal. GenerateNormals(parent); }