public Vector3 GetRandomPoint(POSITION position) { Vector3 point1 = position.value; Vector3 point2 = point1 + position.pivot; float radius = position.pivot.magnitude; Vector3 newSpawnPoint = Vector3.zero; do { switch (position.randomSpawnType) { case RandomSpawnType.Line: newSpawnPoint = Vector3.Lerp(point1, point2, Random.Range(0.0f, 1.0f)); break; case RandomSpawnType.Rect: newSpawnPoint = RandomInRect(point1, point2); break; case RandomSpawnType.Circle: newSpawnPoint = RandomInCircle(point1, point2); break; case RandomSpawnType.Sphere: newSpawnPoint = RandomInSphere(point1, point2); break; default: throw new ArgumentOutOfRangeException(); } } while (Vector3.Distance(newSpawnPoint, _lastSpawnPosition) < Mathf.Sin(Random.Range(0.0f, (float)Math.PI * 0.5f)) * radius); return(_lastSpawnPosition = newSpawnPoint); }
/// <summary> /// Create a markup pointer positioned within the container. /// </summary> /// <returns></returns> public MarkupPointer CreateMarkupPointer(POSITION initialPosition) { MarkupPointer p = MarkupServices.CreateMarkupPointer(); switch (initialPosition) { case POSITION.DOCUMENT_START: p.MoveToContainer(this, true); break; case POSITION.BODY_START: p.MoveAdjacentToElement(Document.body, _ELEMENT_ADJACENCY.ELEM_ADJ_AfterBegin); break; case POSITION.BODY_END: p.MoveAdjacentToElement(Document.body, _ELEMENT_ADJACENCY.ELEM_ADJ_BeforeEnd); break; case POSITION.DOCUMENT_END: p.MoveToContainer(this, false); break; } return(p); }
IEnumerator ChargeTir() { m_isShooting = true; while (!Input.GetButtonUp("ButtonA")) { checkforce(); yield return(null); } startTime = Time.time; SoundManager.Instance.PlayMonoSound(SoundManager.Instance.diceThrow, 1f); foreach (GameObject currentDice in dices) { currentDice.transform.parent = null; force = Mathf.Max(force, 10f); Vector3 AF = transform.forward * force * 30 * multiplierForce; float magn = AF.magnitude; //magn *= Mathf.Tan(Random.Range(accuracy / 2, -accuracy / 2)); magn *= Mathf.Tan(UnityEngine.Random.Range(accuracy / 2, -accuracy / 2)); currentDice.GetComponent <Rigidbody>().AddForce(AF + Vector3.right * magn / 8); currentDice.GetComponent <Rigidbody>().useGravity = true; currentPosition = POSITION.FOLLOW; Dice DR = currentDice.GetComponent <Dice>(); StartCoroutine(DR.checkStill()); direction = transform.position - transform.parent.position; direction.Normalize(); } m_isShooting = false; }
public ImageAndPositionRenderer(Cell modelElement, Image img, String content, POSITION position) : base(modelElement) { this.img = img; this.content = content; this.position = position; }
public void Deplace_toi() { Position_objet_X += Delta_X; Position_objet_Y += Delta_Y; Situation = POSITION.Est_Au_Centre; if (Position_objet_X > Limite_Bord_Droit) { Situation = POSITION.Est_A_Droite; } if (Position_objet_X < Limite_Bord_Gauche) { Situation = POSITION.Est_A_Gauche; } if (Position_objet_Y < Limite_Bord_Haut) { Situation = POSITION.Est_En_Haut; } if (Position_objet_Y > Limite_Bord_Bas) { Situation = POSITION.Est_En_Bas; } }
public ActionResult CreateOrEdit([Bind(Include = "PositionID,PositionName,RoomID")] POSITION pOSITION) { if (ModelState.IsValid) { if (pOSITION.PositionID == null) { //auto create allowanceID int n = 0; var positionList = db.POSITIONs.ToList(); if (positionList.Count > 0) { POSITION r = positionList.Last(); n = Int32.Parse(r.PositionID.Substring(r.PositionID.Length - 2)) + 1; } string id = String.Format("{0:00}", n); pOSITION.PositionID = "P" + id; db.POSITIONs.Add(pOSITION); db.SaveChanges(); return(RedirectToAction("Index")); } else { db.Entry(pOSITION).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } } return(View(pOSITION)); }
public static List <POSITION> MakePositions(TradeSharpConnectionPersistent conn, int accountId) { var allPositions = new List <POSITION>(); // создать сделки по счету var tickers = new[] { "EURUSD", "USDJPY", "AUDUSD", "EURCAD" }; var timeNow = DateTime.Now; var times = new[] { timeNow.AddDays(-2), timeNow.AddDays(-1), timeNow.AddHours(-1) }; var sides = new[] { -1, 1 }; foreach (var ticker in tickers) { foreach (var side in sides) { foreach (var time in times) { var quote = QuoteStorage.Instance.ReceiveValue(ticker); var pos = new POSITION { AccountID = accountId, Symbol = ticker, Side = side, TimeEnter = time, State = (int)PositionState.Opened, PriceEnter = (decimal)(side == 1 ? quote.ask : quote.bid), Volume = 100000 }; allPositions.Add(pos); conn.POSITION.Add(pos); } } } return(allPositions); }
public DefensiveAttributes(int _fielding, int _throwing, int _range, int _athleticity, POSITION _positionPlayed) { fielding = _fielding; throwing = _throwing; range = _range; athleticity = _athleticity; positionPlayed = _positionPlayed; }
public static void UpdatePosition(POSITION position, bool control) { PositionDAO.UpdatePosition(position); if (control) { EmployeeDAO.UpdateEmployee(position); } }
void staticCamera() { if (Input.GetButtonDown("ButtonX")) { currentPosition = POSITION.FOLLOW; } //reculer suivant distance entre les 2 dès les plus éloignés }
public static void UpdateEmployee(POSITION position) { List <EMPLOYEE> list = db.EMPLOYEEs.Where(x => x.PositionID == position.ID).ToList(); foreach (var item in list) { item.DepartmentID = Convert.ToInt32(position.DepartmentID); } db.SubmitChanges(); }
/// <summary> /// Add a new Position /// </summary> /// <param name="Position">The Position to add</param> /// <returns>True if Position is added successfuly otherwise false</returns> public bool AddPosition(POSITION position) { if (position != null) { db.POSITIONs.Add(position); db.SaveChanges(); return(true); } return(false); }
void rapidDisplacment() { if (Input.GetButtonDown("ButtonX")) { currentPosition = POSITION.ROTATEARROUND; } if (Input.GetButtonDown("ButtonA")) { goScope(); } }
public Staff(string name, string phone, string barcode, POSITION pos, DateTime prDate, bool uvol, DateTime uvolDate, bool vozv, bool udal, decimal stavka) : base(name, true, phone, barcode) { Position = pos; PrinyatDate = prDate; Uvolen = uvol; UvolenDate = uvolDate; Vozvrat = vozv; Udalenie = udal; Stavka = stavka; }
void rotateArround() { if (Input.GetButtonDown("ButtonX")) { currentPosition = POSITION.RAPIDDISPLACMENT; } if (Input.GetButtonDown("ButtonA")) { goScope(); } }
public static void addPosition(POSITION position) { try { db.POSITIONs.InsertOnSubmit(position); db.SubmitChanges(); }catch (Exception ex) { throw ex; } }
private bool ModifyClosedPosition(MarketOrder order, TradeSharpConnection ctx, POSITION_CLOSED pos, out string errorString) { errorString = string.Empty; if (order.IsClosed) { var opened = new POSITION { AccountID = pos.AccountID, ID = pos.ID, Comment = order.Comment, Magic = order.Magic, ExpertComment = order.ExpertComment, PendingOrderID = order.PendingOrderID, PriceBest = (decimal?)order.PriceBest, PriceEnter = (decimal)order.PriceEnter, PriceWorst = (decimal?)order.PriceWorst, Side = order.Side, Stoploss = (decimal?)order.StopLoss, Symbol = order.Symbol, Takeprofit = (decimal?)order.TakeProfit, TimeEnter = order.TimeEnter, Volume = order.Volume, State = (int)order.State, MasterOrder = order.MasterOrder }; ctx.POSITION_CLOSED.Remove(pos); ctx.POSITION.Add(opened); return(true); } pos.Comment = order.Comment; pos.Magic = order.Magic; pos.ExpertComment = order.ExpertComment; pos.PendingOrderID = order.PendingOrderID; pos.PriceBest = (decimal?)order.PriceBest; pos.PriceEnter = (decimal)order.PriceEnter; pos.PriceWorst = (decimal?)order.PriceWorst; pos.Side = order.Side; pos.Stoploss = (decimal?)order.StopLoss; pos.Symbol = order.Symbol; pos.Takeprofit = (decimal?)order.TakeProfit; pos.TimeEnter = order.TimeEnter; pos.Volume = order.Volume; pos.ExitReason = (int)order.ExitReason; pos.PriceExit = (decimal)(order.PriceExit ?? 0); pos.PriceWorst = (decimal?)order.PriceWorst; pos.ResultBase = (decimal)order.ResultBase; pos.ResultDepo = (decimal)order.ResultDepo; pos.ResultPoints = (decimal)order.ResultPoints; pos.TimeExit = order.TimeExit ?? default(DateTime); pos.Swap = (decimal)(order.Swap ?? 0); ctx.SaveChanges(); return(true); }
public Form1() { InitializeComponent(); this.Width = width; this.Height = height; this.DoubleBuffered = true; cubePosition = POSITION.LEFT; movingVector = new Vector3D(cube.size * 2, 0, 0); timer1.Start(); }
/// <summary> /// Constructor. /// /// There are two ways to specify the verbatim code: directly (verbatimCode) /// or from a file (verbatimCodeFile). /// <param name="filenames">Into what file(s) should the code be inserted. /// Multiple files can be specified (e.g., when multiple files need to include the same header). /// If a filename is not an absolute path, then the output directory will be /// prefixed (at verbatim-code-insertion-time).</param> /// <param name="where">Where to put the custom code.</param> /// <param name="customMarker">A custom string that is used to locate 'where' when /// 'where' is BEFORE_MARKER or AFTER_MARKER.</param> /// <param name="verbatimCode">The verbatim code the be inserted.</param> /// <param name="verbatimCodeFile">The file to read the verbatim code from, to be inserted. /// If the path is not absolute, the filename is relative to the dir where the specification came from.</param> /// </summary> public VerbatimCode( List <string> filenames, POSITION where, string customMarker, string verbatimCode, string verbatimCodeFile) { m_filenames = filenames; m_where = where; m_customMarker = customMarker; m_verbatimCode = verbatimCode; m_verbatimCodeFile = verbatimCodeFile; }
public static void DeletePosition(int iD) { try { POSITION pst = db.POSITIONs.First(x => x.ID == iD); db.POSITIONs.DeleteOnSubmit(pst); db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
/// <summary> /// Constructor. /// /// There are two ways to specify the verbatim code: directly (verbatimCode) /// or from a file (verbatimCodeFile). /// <param name="filenames">Into what file(s) should the code be inserted. /// Multiple files can be specified (e.g., when multiple files need to include the same header). /// If a filename is not an absolute path, then the output directory will be /// prefixed (at verbatim-code-insertion-time).</param> /// <param name="where">Where to put the custom code.</param> /// <param name="customMarker">A custom string that is used to locate 'where' when /// 'where' is BEFORE_MARKER or AFTER_MARKER.</param> /// <param name="verbatimCode">The verbatim code the be inserted.</param> /// <param name="verbatimCodeFile">The file to read the verbatim code from, to be inserted. /// If the path is not absolute, the filename is relative to the dir where the specification came from.</param> /// </summary> public VerbatimCode( List<string> filenames, POSITION where, string customMarker, string verbatimCode, string verbatimCodeFile) { m_filenames = filenames; m_where = where; m_customMarker = customMarker; m_verbatimCode = verbatimCode; m_verbatimCodeFile = verbatimCodeFile; }
void OnMouseUp() { if (y == hover_y && player1.suaVez == true && cardPosition == POSITION.HAND) { if (transform.localPosition.y > -1.7f && this.borda.enabled == true) { Debug.Log("Campo IF Player 2"); cardPosition = POSITION.INPLAY; player1.campo.Add(gameObject); player1.mao.RemoveAt(position); player1status.mana = player1status.mana - this.properties.comando; this.borda.enabled = false; player1.OrganizeCards(); if ((this.properties.card_tipo.ToString() == "Tipo: Apoio") && this.properties.card_name == "Colete" || this.properties.card_name == "Barricada") { Debug.Log("Eh do tipo apoio"); player1.SetSelected(gameObject); Debug.Log("Esperando para destruir"); player1.efeitoCarta = this.properties.card_name; } } } else if (y == hover_y2 && player2.suaVez == true && cardPosition == POSITION.HAND) { if (transform.localPosition.y < 1.4f && this.borda.enabled == true) { Debug.Log("Campo de batalha"); cardPosition = POSITION.INPLAY; player2.campo.Add(gameObject); player2.mao.RemoveAt(position); player2status.mana = player2status.mana - this.properties.comando; this.borda.enabled = false; player2.OrganizeCards(); if ((this.properties.card_tipo.ToString() == "Tipo: Apoio") && this.properties.card_name == "Colete" || this.properties.card_name == "Barricada") { Debug.Log("Eh do tipo apoio 2"); player2.SetSelected(gameObject); Debug.Log("Esperando para destruir"); player2.efeitoCarta = this.properties.card_name; } } // if (transform.localScale.x == 2 && transform.localScale.y == 2) // { // transform.localScale = new Vector3(transform.localScale.x/2f, transform.localScale.y/2f, transform.localScale.z/2f); // transform.Translate( new Vector3(0f, 0f, .2f)); // scaledUp = false; // } } }
public static void UpdatePosition(POSITION position) { try { POSITION pst = db.POSITIONs.First(x => x.ID == position.ID); pst.PositionName = position.PositionName; pst.DepartmentID = position.DepartmentID; db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public static void UpdatePosition(POSITION position) { try { POSITION pos = db.POSITION.First(x => x.ID == position.ID); pos.Position1 = position.Position1; pos.DepID = position.DepID; db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
//[ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(string id) { try { POSITION pOSITION = db.POSITIONs.Find(id); db.POSITIONs.Remove(pOSITION); db.SaveChanges(); } catch { return(Json(new { success = false })); } return(Json(new { success = true })); }
public void ActivatePosition(POSITION position) { if (position == POSITION.LEFT) { serial.Send(C1_CLICK); } else if (position == POSITION.CENTER) { serial.Send(C2_CLICK); } else { serial.Send(C3_CLICK); } }
public void InitGizmo(int id, POSITION position) { _position = position; _id = id; _baseGizmo.onGizmoMoved.AddListener(x => GizmoMoved()); _offsetGizmo.onGizmoMoved.AddListener(x => GizmoMoved()); UpdateGizmo(id); if (position.randomSpawnType != RandomSpawnType.None) { _offsetGizmo.transform.position = position.value + position.pivot; } }
public static ModelInput RecreateRealModel(ModelInput origin) { if (origin.type == ModelData.DURATION.TYPE) { return(DURATION.CopyValues(origin)); } if (origin.type == ModelData.APPEAR.TYPE) { return(APPEAR.CopyValues(origin)); } if (origin.type == ModelData.SIZE.TYPE) { return(SIZE.CopyValues(origin)); } if (origin.type == ModelData.SPEED.TYPE) { return(SPEED.CopyValues(origin)); } if (origin.type == ModelData.POSITION.TYPE) { return(POSITION.CopyValues(origin)); } if (origin.type == ModelData.ROTATION.TYPE) { return(ROTATION.CopyValues(origin)); } if (origin.type == ModelData.EVENT.TYPE) { return(EVENT.CopyValues(origin)); } if (origin.type == ModelData.COUNT.TYPE) { return(COUNT.CopyValues(origin)); } if (origin.type == ModelData.SHAPE.TYPE) { return(SHAPE.CopyValues(origin)); } if (origin.type == ModelData.PROJECTILE.TYPE) { return(PROJECTILE.CopyValues(origin)); } return(null); }
protected void RecalcualteTrustValue() { const float PUBLISHPOINTSSPERSUBNET = 10.0f; // The trustvalue is supposed to be an indicator how trustworthy/important (or spamy) this entry is and lies between 0 and ~10000, // but mostly we say everything below 1 is bad, everything above 1 is good. It is calculated by looking at how many differnt // IPs/24 have published this entry and how many entries each of those IPs have. // Each IP/24 has x (say 3) points. This means if one IP publishs 3 differnt entries without any other IP publishing those entries, // each of those entries will have 3 / 3 = 1 Trustvalue. Thats fine. If it publishes 6 alone, each entry has 3 / 6 = 0.5 trustvalue - not so good // However if there is another publisher for entry 5, which only publishes this entry then we have 3/6 + 3/1 = 3.5 trustvalue for this entry // // Whats the point? With this rating we try to avoid getting spammed with entries for a given keyword by a small IP range, which blends out // all other entries for this keyword do to its amount as well as giving an indicator for the searcher. So if we are the node to index "Knoppix", and someone // from 1 IP publishes 500 times "knoppix casino 500% bonus.txt", all those entries will have a trsutvalue of 0.006 and we make sure that // on search requests for knoppix, those entries are only returned after all entries with a trustvalue > 1 were sent (if there is still space). // // Its important to note that entry with < 1 do NOT get ignored or singled out, this only comes into play if we have 300 more results for // a search request rating > 1 if (m_pliPublishingIPs == NULL) { ASSERT(false); return; } dwLastTrustValueCalc = ::GetTickCount(); m_fTrustValue = 0; ASSERT(!m_pliPublishingIPs->IsEmpty()); for (POSITION pos = m_pliPublishingIPs->GetHeadPosition(); pos != NULL; m_pliPublishingIPs->GetNext(pos)) { structPublishingIP curEntry = m_pliPublishingIPs->GetAt(pos); uint32 nCount = 0; s_mapGlobalPublishIPs.Lookup(curEntry.m_uIP & 0xFFFFFF00 /* /24 netmask, take care of endian if needed*/, nCount); if (nCount > 0) { m_fTrustValue += PUBLISHPOINTSSPERSUBNET / nCount; } else { DebugLogError(_T("Kad: EntryTrack: Inconsistency RecalcualteTrustValue()")); ASSERT(false); } } }
private void btnSave_Click(object sender, EventArgs e) { if (txtPosition.Text.Trim() == "") { MessageBox.Show("Please fill the position name"); } else if (cmbDepartment.SelectedIndex == -1) { MessageBox.Show("Please select a department"); } else { if (!isUpdated) { POSITION position = new POSITION(); position.Position1 = txtPosition.Text; position.DepID = Convert.ToInt32(cmbDepartment.SelectedValue); PositionBLL.AddPosition(position); MessageBox.Show("Position added"); txtPosition.Clear(); cmbDepartment.SelectedIndex = -1; } else { POSITION position = new POSITION(); position.ID = detail.ID; position.Position1 = txtPosition.Text; position.DepID = Convert.ToInt32(cmbDepartment.SelectedValue); bool control = false; if (Convert.ToInt32(cmbDepartment.SelectedValue) != detail.OldDepartmentID) { control = true; } PositionBLL.UpdatePosition(position, control); MessageBox.Show("Position updated!"); this.Close(); } } }
/// <summary> /// Открывает новую сделку в ручную /// </summary> /// <param name="positionItem">экземпляр модели данных</param> /// <returns>Удачно ли выполнено добавления сделки</returns> public bool NewDeal(PositionItem positionItem) { try { using (var ctx = DatabaseContext.Instance.Make()) { var acc = ctx.ACCOUNT.FirstOrDefault(a => a.ID == positionItem.AccountID); Logger.Error("NewDeal - ошибка открытия сделки в ручную. Не удалось найти счёт с номером " + positionItem.AccountID); if (acc == null) { return(false); } var newPosition = new POSITION { AccountID = positionItem.AccountID, Symbol = positionItem.Symbol, TimeEnter = positionItem.TimeEnter, PriceEnter = positionItem.PriceEnter, Volume = positionItem.Volume, Side = positionItem.Side, State = (int)positionItem.State }; ctx.POSITION.Add(newPosition); ctx.SaveChanges(); } } catch (UpdateException ex) { Logger.Error("NewDeal - ошибка открытия сделки в ручную. Ошибка добавления в базу данных. Возможно сущьность с таким идентификатором уже существует или указаны некорректные параметры", ex); return(false); } catch (Exception ex) { Logger.Error("NewDeal - ошибка открытия сделки в ручную", ex); return(false); } return(true); }
private void btnSave_Click(object sender, EventArgs e) { if (txtPosition.Text.Trim() == "") { MessageBox.Show("Please fill the position name"); } else if (cmbDeparment.SelectedIndex == -1) { MessageBox.Show("Please select a department"); } else { POSITION position = new POSITION(); position.PositionName = txtPosition.Text; position.DepartmentID = Convert.ToInt32(cmbDeparment.SelectedValue); PositionBLL.AddPosition(position); MessageBox.Show("Position was added"); txtPosition.Clear(); cmbDeparment.SelectedIndex = -1; } }
void follow() { if (Input.GetButtonDown("ButtonX")) { currentPosition = POSITION.STATIC; } SelectDices(); getMiddleOfThree(); journeyLength = Vector3.Distance(transform.position, endMarker); transform.DOMoveY(endMarker.y, verticalTimeMove); transform.DOMoveX(endMarker.x, horizontalTimeMove); transform.DOMoveZ(endMarker.z, horizontalTimeMove); //transform.DOMove(endMarker, 12f); /** Look At */ Vector3 dir = middle - transform.position; float Phi = Mathf.Acos(dir.y / dir.magnitude) * 180 / Mathf.PI; float Teta = Mathf.Atan2(transform.position.z, transform.position.x) * 180 / Mathf.PI; transform.DORotate(new Vector3(Phi - 90, -90 - Teta, 0), 2); /************/ }
public Vector2 GetCorner(POSITION aPosition) { Assert.FailIfNull(aPosition, "aPosition"); return this.corners[(int)aPosition]; }
void OnMouseUp() { if (y == hover_y && player1.suaVez == true && cardPosition == POSITION.HAND) { if (transform.localPosition.y > -1.7f && this.borda.enabled == true) { Debug.Log("Campo IF Player 2"); cardPosition = POSITION.INPLAY; player1.campo.Add(gameObject); player1.mao.RemoveAt(position); player1status.mana = player1status.mana - this.properties.comando; this.borda.enabled = false; player1.OrganizeCards(); if ((this.properties.card_tipo.ToString() == "Tipo: Apoio") && this.properties.card_name == "Colete" || this.properties.card_name == "Barricada") { Debug.Log ("Eh do tipo apoio"); player1.SetSelected(gameObject); Debug.Log ("Esperando para destruir"); player1.efeitoCarta = this.properties.card_name; } } } else if (y == hover_y2 && player2.suaVez == true && cardPosition == POSITION.HAND) { if (transform.localPosition.y < 1.4f && this.borda.enabled == true) { Debug.Log("Campo de batalha"); cardPosition = POSITION.INPLAY; player2.campo.Add(gameObject); player2.mao.RemoveAt(position); player2status.mana = player2status.mana - this.properties.comando; this.borda.enabled = false; player2.OrganizeCards(); if ((this.properties.card_tipo.ToString() == "Tipo: Apoio") && this.properties.card_name == "Colete" || this.properties.card_name == "Barricada") { Debug.Log ("Eh do tipo apoio 2"); player2.SetSelected(gameObject); Debug.Log ("Esperando para destruir"); player2.efeitoCarta = this.properties.card_name; } } // if (transform.localScale.x == 2 && transform.localScale.y == 2) // { // transform.localScale = new Vector3(transform.localScale.x/2f, transform.localScale.y/2f, transform.localScale.z/2f); // transform.Translate( new Vector3(0f, 0f, .2f)); // scaledUp = false; // } } }
internal void Set(POSITION start, POSITION end) { Set(start.x, start.y, end.x, end.y); }
private void Set(int startColIndex, int startRowIndex, int endColIndex, int endRowIndex) { if (!Vals.ContainsKey(GlobalVars.Instance.CurrentPlateID)) Vals.Add(GlobalVars.Instance.CurrentPlateID, new Dictionary<POSITION, string>()); Dictionary<POSITION, string> curPlatePosVals = Vals[GlobalVars.Instance.CurrentPlateID]; for (int x = startColIndex; x < endColIndex; x++) { for (int y = startRowIndex; y < endRowIndex; y++) { POSITION pos = new POSITION(x, y); if (curPlatePosVals.ContainsKey(pos)) curPlatePosVals[pos] = GlobalVars.Instance.PCRType; else curPlatePosVals.Add(pos, GlobalVars.Instance.PCRType); } } }
private void timer1_Tick(object sender, EventArgs e) { float x = movingVector.x; float y = movingVector.y; float z = movingVector.z; switch (cubePosition) { case POSITION.LEFT: if (z <= cube.size * 2) z += movingDelta; else cubePosition = POSITION.TOP_LEFT; break; case POSITION.TOP_LEFT: if (x >= 0) x -= movingDelta; else cubePosition = POSITION.SPINNING; break; case POSITION.SPINNING: if (!spinning) spinning = true; if (spinning) { if(rotation != 180) rotation += rotationDelta; else { rotation = 0; spinning = false; cubePosition = POSITION.TOP_RIGHT; } } break; case POSITION.TOP_RIGHT: if (x >= -cube.size * 2) x -= movingDelta; else cubePosition = POSITION.RIGHT; break; case POSITION.RIGHT: if (z >= -cube.size * 2) z -= movingDelta; else cubePosition = POSITION.BOTTOM; break; case POSITION.BOTTOM: if (x <= cube.size * 2) x += movingDelta; else cubePosition = POSITION.LEFT; break; default: break; } movingVector.x = x; movingVector.y = y; movingVector.z = z; Invalidate(); }
/// <summary> /// Create a markup pointer positioned within the container. /// </summary> /// <returns></returns> public MarkupPointer CreateMarkupPointer(POSITION initialPosition) { MarkupPointer p = MarkupServices.CreateMarkupPointer(); switch (initialPosition) { case POSITION.DOCUMENT_START: p.MoveToContainer(this, true); break; case POSITION.BODY_START: p.MoveAdjacentToElement(Document.body, _ELEMENT_ADJACENCY.ELEM_ADJ_AfterBegin); break; case POSITION.BODY_END: p.MoveAdjacentToElement(Document.body, _ELEMENT_ADJACENCY.ELEM_ADJ_BeforeEnd); break; case POSITION.DOCUMENT_END: p.MoveToContainer(this, false); break; } return p; }
public int Face(int x, int y, int z, POSITION p) { return model[x, y, z, (int)p - 1]; }