private PL_Base Solve(string statement, out TruthTable truthTable) { PL_Base PL_Statement; try { switch (currentType) { case SystemType.PL: PL_Statement = new PL(statement); break; case SystemType.PL_DASH1: PL_Statement = new PL_Dash1(statement); break; case SystemType.PL_DASH2: PL_Statement = new PL_Dash2(statement); break; default: PL_Statement = new PL_Dash3(statement); break; } PL_Statement.GenerateTruthTable(); truthTable = PL_Statement.TruthTable; return(PL_Statement); } catch (MalFormedException) { throw; } }
protected void UpdateDataView() { if (plCode != null) { PL p = PL.GetByKey(plCode); txtCode.Text = p.Code; txtPath.Text = p.Organization.Name + "/" + p.Group.Name + "/" + p.GBU.Name; txtName.Text = p.Name; cbActive.Checked = p.IsActive; cbActive.Enabled = !cbActive.Checked; ddlBusName.DataSource = getBusinesses().Tables[0]; ddlBusName.DataTextField = "BusinessName"; ddlBusName.DataValueField = "BusinessId"; ddlBusName.DataBind(); ddlBusName.Items.Insert(0, new ListItem("--- Select ---", "0")); if (p.BusinessId.Trim() == "") { ddlBusName.SelectedIndex = 0; cbPMActive.Checked = false; } else { ddlBusName.SelectedIndex = ddlBusName.Items.IndexOf(new ListItem(p.BusinessName.Trim(), p.BusinessId.Trim())); ddlBusName.Enabled = false; cbPMActive.Checked = true; } UITools.ShowToolBarButton(uwToolbar, "Save"); if (!cbActive.Enabled) { //UITools.HideToolBarButton(uwToolbar, "Save"); lbUsage.Text = "This PL is currently attached to item or input forms"; } } }
private PL[][] getPlByPosition(int[] pos) { /* * Pos arrayin 3. değerinden sonraki değerler {x,y} şeklinde en yakın, aynı takıma ait PL konumunu söyler * Bu Konumdan yola çıkarak, aradaki Pl'ler bulunur. * * Örn: fx,fy pos[3],pos[4] * *------------------* arada kalan Pl'leri bulur * */ int to = (pos.Length - 3) / 2; int fx = pos[0]; int fy = pos[1]; List <PL[]> l = new List <PL[]>(); for (int i = 0; i < to; i++) { int tx = pos[3 + i * 2]; int ty = pos[3 + i * 2 + 1]; int dx = tx - fx; int dy = ty - fy; int ax = dx == 0?0:(dx) / Mathf.Abs(dx); int ay = dy == 0 ? 0 : (dy) / Mathf.Abs(dy); int countTo = Mathf.Abs((dx == 0 ? dy : dx)) - 1; //Debug.Log("PLPOS: " + countTo); PL[] arry = new PL[countTo]; for (int c = 1; c <= countTo; c++) { //Debug.Log("Found: " + "Cou: " + c + " ay:" + ay + " ax:" + ax + " P:" + map[fx + (ax * c), fy + (ay * c)].getGamePosition()); arry[c - 1] = map[fx + (ax * c), fy + (ay * c)]; } l.Add(arry); } return(l.ToArray()); }
/// <summary> /// Translates all the localization strings into the main language /// </summary> public static void TranslateAll() { var terms = Resources.FindObjectsOfTypeAll <Text>(); if (!isInitialized) { initialize(); } set = delegate(SystemLanguage lang, string term, int i) { string o; terms[i].text = (s[lang].TryGetValue(term, out o)) ? o : terms[i].text = term; }; for (var i = 0; i < terms.Length; i++) { var t = Regex.Match(terms[i].text, "{(.*?)}"); if (t.Success) { var term = t.Groups[1].Value; if (s[cc].ContainsKey(term)) { set(cc, term, i); } else { set(fallbackLanguage, term, i); } } } }
public ActionResult ShowAllSales(int?manager, string product, string date) { using (IPL db = new PL()) { IEnumerable <SaleViewModel> sales = db.GetSales(); IList <ManagerViewModel> managers = db.GetManagers().ToList(); managers.Insert(0, new ManagerViewModel { ManagerID = 0, LastName = "Все" }); IList <string> products = sales.Select(x => x.Product).Distinct().ToList(); products.Insert(0, "Любой"); IList <DateTime> dates = sales.Select(x => x.Date).Distinct().ToList(); IList <string> datesForFilter = new List <string>(); foreach (var item in dates) { datesForFilter.Add(String.Format("{0:d}", item)); } datesForFilter.Insert(0, "Даты нет"); datesForFilter = datesForFilter.Distinct().ToList(); FilterModel filter = new FilterModel { Sales = sales, Managers = new SelectList(managers, "ManagerId", "LastName"), Products = new SelectList(products), Dates = new SelectList(datesForFilter) }; return(View(filter)); } }
// Use this for initialization void Start() { PL MyPL = new PL(); MyPL.Attack(); MyPL.Damage(30); }
protected virtual Location HandleLocationNotFound(PL patientLocation, EntityNotFoundException e) { string locationName = patientLocation.PointOfCare.Value; Facility facility; try { facility = FindFacility(patientLocation.Facility.NamespaceID.Value, PersistenceContext); } catch (Exception) { facility = null; } var location = new Location { Id = locationName, Name = locationName, PointOfCare = locationName, Facility = facility, Deactivated = false, Description = "HL7" }; PersistenceContext.Lock(location, DirtyState.New); return(location); }
protected void HandlePatientLocation(Visit visit, PL patientLocation, bool isCurrent) { var location = FindLocation(patientLocation); var visitLocation = new VisitLocation { Role = VisitLocationRole.CR, Location = location, Room = patientLocation.Room.Value, Bed = patientLocation.Bed.Value, StartTime = Platform.Time }; if (isCurrent) { visit.Facility = location.Facility; visit.CurrentLocation = visitLocation.Location; visit.CurrentRoom = visitLocation.Room; visit.CurrentBed = visitLocation.Bed; } visit.Locations.Add(visitLocation); foreach ( var existing in visit.Locations.Where( existing => existing != visitLocation && existing.Role == visitLocation.Role && existing.EndTime.HasValue == false)) { existing.EndTime = Platform.Time; } }
public ActionResult FilterSales(int?manager, string product, string date) { using (IPL db = new PL()) { IEnumerable <SaleViewModel> sales = db.GetSales(); if (manager != 0 && manager != null) { sales = sales.Where(x => x.ManagerId == manager); } if (!String.IsNullOrEmpty(product) && !product.Equals("Любой")) { sales = sales.Where(x => x.Product == product); } if (date != null && !date.Equals("Даты нет")) { DateTime time; DateTime.TryParse(date, out time); sales = sales.Where(x => x.Date.Day == time.Day && x.Date.Month == time.Month && x.Date.Year == time.Year); } FilterModel filter = new FilterModel { Sales = sales }; return(PartialView(filter)); } }
private float playSpawnAnim(PL animToPlay, int no) { string animName = "s" + no; animToPlay.getPlAnim().Play(animName); return(0.5f); }
/// /// </summary> public void Load() { // intialize dbRepository dbrep = new dbRepository(); dbOriginalRepository dbrepOriginal = new dbOriginalRepository(); List <PL> listPL = new List <PL>(); foreach (Projectleider plitem in dbrep.GetProjectleiders()) { persoon tt = dbrepOriginal.GetContact(plitem.ContactIdOrigineel); PL pl = new PL(); pl.Naam = tt.voornaam + " " + tt.tussenvoegsel + " " + tt.achternaam; pl.ProjectleiderId = plitem.ProjectleiderId; pl.ContactIdOrigineel = plitem.ContactIdOrigineel; listPL.Add(pl); } cbProjectleiders.ItemsSource = listPL; cbProjectleiders.DisplayMemberPath = "Naam"; cbProjectleiders.SelectedValuePath = "ProjectleiderId"; cbProjectleiders.SelectedValue = ApplicationState.GetValue <int>(ApplicationVariables.intProjectleider); }
void gravitizeObjects() { foreach (Platform PL in FindObjectsOfType <Platform>()) { PL.GetComponent <Rigidbody>().useGravity = true; } }
public void ReadMiuInput(string s) { input = s; PLProp plp = PL.GetComponent <PLProp>(); plp.miu = float.Parse(input); }
public void ReadAngleInput(string s) { input = s; PLProp plp = PL.GetComponent <PLProp>(); plp.angle = float.Parse(input); }
private void UpdatePLTolbar() { PLProp pl = PL.GetComponent <PLProp>(); Miu.text = pl.miu.ToString(); Angle.text = pl.angle.ToString(); }
private void UpdateDataView() { UserList plUsers = PL.GetByKey(plCode).Users; vPLUsers = new CollectionView(plUsers); UserList users = HyperCatalog.Business.User.GetAll("IsActive = 1"); if (users != null) { dg.DataSource = users; Utils.InitGridSort(ref dg, false); dg.DataBind(); if (dg.Rows.Count > 0) { dg.Visible = true; lbNoresults.Visible = false; } else { lbNoresults.Text = "No user found"; dg.Visible = false; lbNoresults.Visible = true; } } }
private IEnumerator startAnim(PL first, PL[][] others, int teamToChange) { first.getPlAnim().Play("s0"); yield return(new WaitForSeconds(0.5f)); int count = 0; for (int o = 0; o < others.Length; o++) { count += others[o].Length; } Debug.Log("Anim: t:" + teamToChange + " c:" + others.Length + " " + count); //yield return new WaitForSeconds(0.5f); for (int i = 0; i < others.Length; i++) { first.lookAt(others[i][0].getTransform()); first.getPlAnim().Play(firstAnim); if (firstWait != 0) { yield return(new WaitForSeconds(firstWait)); } for (int j = 0; j < others[i].Length; j++) { Debug.Log("Loop: " + i + " " + j + " p:" + others[i][j].getGamePosition()); others[i][j].getPlAnim().Play(otherAnim); yield return(new WaitForSeconds(otherWait / 2)); others[i][j].teamNo = teamToChange; yield return(new WaitForSeconds(otherWait / 2)); //others[i][j].getPlAnim().enabled = false; } } }
public ActionResult ShowAllManagers() { using (IPL db = new PL()) { ViewBag.Managers = db.GetManagers(); } return(View()); }
/// <summary> /// 创建fieldtype,如CE,XCN等 /// </summary> /// <param name="parent"></param> /// <param name="product"></param> /// <param name="name"></param> /// <returns></returns> public override abstractType Create(compositeType parent, Enum product, string name) { abstractType tmp = null; switch (product) { case enumField.CE: tmp = new CE(parent, name); break; case enumField.CM: tmp = new CM(parent, name); break; case enumField.CWE: tmp = new CWE(parent, name); break; case enumField.CX: tmp = new CX(parent, name); break; case enumField.DLN: tmp = new DLN(parent, name); break; case enumField.EI: tmp = new EI(parent, name); break; case enumField.ELD: tmp = new ELD(parent, name); break; case enumField.FN: tmp = new FN(parent, name); break; case enumField.HD: tmp = new HD(parent, name); break; case enumField.MSG: tmp = new MSG(parent, name); break; case enumField.PT: tmp = new PT(parent, name); break; case enumField.VID: tmp = new VID(parent, name); break; case enumField.XAD: tmp = new XAD(parent, name); break; case enumField.XCN: tmp = new XCN(parent, name); break; case enumField.XPN: tmp = new XPN(parent, name); break; case enumField.XTN: tmp = new XTN(parent, name); break; case enumField.ERL: tmp = new ERL(parent, name); break; case enumField.FC: tmp = new FC(parent, name); break; case enumField.XON: tmp = new XON(parent, name); break; case enumField.PL: tmp = new PL(parent, name); break; case enumField.CP: tmp = new CP(parent, name); break; case enumField.JCC: tmp = new JCC(parent, name); break; case enumField.TQ: tmp = new TQ(parent, name); break; case enumField.CQ: tmp = new CQ(parent, name); break; default: throw new NotSupportedException(); } return(tmp); }
// GET: Profit public ActionResult Index() { List <PL> pls = new List <PL>(); // get realised profit var profits = db.Profits.Include(p => p.Stock); foreach (Profit p in profits) { PL pl = new PL(); pl.Stock = p.Stock; pl.RealisedAmount = p.Amount * ExchangeRateService.GetRate(p.Stock.Currency); pls.Add(pl); } // get unrealised profit var portfolios = db.Portfolios.Include(p => p.Stock); foreach (Portfolio p in portfolios) { PL pl = pls.Where(item => item.Stock.ID == p.StockID).FirstOrDefault(); if (pl == null) { pl = new PL(); pl.Stock = p.Stock; pls.Add(pl); } pl.UnrealisedAmount = p.PL; } // add divident var dividents = db.Dividents.Include(p => p.Stock); foreach (Divident d in dividents) { PL pl = pls.Where(item => item.Stock.ID == d.StockID).FirstOrDefault(); if (pl == null) { pl = new PL(); pl.Stock = d.Stock; pls.Add(pl); } pl.RealisedAmount += d.AmountSGD; } // update total profit/loss foreach (PL pl in pls) { pl.Amount = pl.RealisedAmount + pl.UnrealisedAmount; } decimal totalAmountSGD = (from od in pls select od.Amount).Sum(); ViewBag.TotalAmountSGD = totalAmountSGD; return(View(pls)); }
/*private void Update() * { * if (PLSelected) * UpdatePLTolbar(); * }*/ public void EnablePLTolbar() { PLTolbar.SetActive(true); PLProp pl = PL.GetComponent <PLProp>(); Miu.text = pl.miu.ToString(); Angle.text = pl.angle.ToString(); PLSelected = true; }
private float playTurnAnim(PL[][] willTurn, PL first, int teamTo, int decidedAnim) { if (anims.Count == 0 || decidedAnim < 0) { defaultAnim(willTurn, first, teamTo); return(0); } ConvertAnimation c = anims[decidedAnim]; return(c.play(first, willTurn, teamTo)); }
public ActionResult DeleteSale(int Id) { using (IPL db = new PL()) { if (db.DeleteSale(Id)) { return(RedirectToAction("ShowAllSales", "Admin")); } } return(View()); }
public ActionResult DeleteUser(string login) { using (IPL db = new PL()) { if (db.DeleteUser(login)) { return(RedirectToAction("ShowAllUsers", "Admin")); } } return(View()); }
private void defaultAnim(PL[][] willTurn, PL first, int teamTo) { first.teamNo = teamTo; foreach (PL[] arr in willTurn) { foreach (PL p in arr) { p.teamNo = teamTo; } } }
public override float play(PL first, PL[][] others, int teamToChange) { float total = 0.5f; for (int i = 0; i < others.Length; i++) { total += others[i].Length * otherWait; } total += (firstWait * others.Length); rutine = GameV2.active.StartCoroutine(startAnim(first, others, teamToChange)); return(total); }
// 6 List of PayLoad public void AddListPayLoad(List <NewPayLoad> elements) { CheckBuffer(5); WriteValueType(ListPayLoadType); //TODO: replace to WriteLen WriteInt(elements.Count); foreach (NewPayLoad PL in elements) { WriteBytes(PL.GetPackage()); } }
private void UpdateDataEdit(string selPLCode) { panelGrid.Visible = false; webTab.Tabs.GetTab(0).ContentPane.TargetUrl = "./pls/pl_properties.aspx?p=" + selPLCode; PL p = PL.GetByKey(selPLCode); lbTitle.Text = "PL: [" + p.Code + "] " + p.Name; webTab.Tabs[1].Visible = true; webTab.Tabs.GetTab(1).ContentPane.TargetUrl = "./pls/pl_users.aspx?p=" + selPLCode; webTab.Visible = true; webTab.Tabs[2].Visible = false; }
void destroyObjects() { foreach (Platform PL in FindObjectsOfType <Platform>()) { PL.immidiateDestroy(); } foreach (Diamond DI in FindObjectsOfType <Diamond>()) { DI.shinkDestroy(); } resetLastPositionToOrigin(); }
private PL createPL(int x, int y, int teamNo) { x = Mathf.Clamp(x, 0, map_size); y = Mathf.Clamp(y, 0, map_size); if (getPlType(x, y) != -1) { return(null); } map[x, y] = new PL(x, y, teamNo); return(map[x, y]); // todo bitmedi }
public override void OnSetID() { enabled = true; if (isMine) { txt.renderer.enabled = false; _LocalPlayer = this; Spawn(); } else { name += "remote"; } base.OnSetID(); }
/// <summary> Returns all repetitions of Location Resource ID (AIL-3).</summary> public virtual PL[] getLocationResourceID() { PL[] ret = null; try { Type[] t = this.getField(3); ret = new PL[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (PL) t[i]; } } catch (System.InvalidCastException ) { throw new Exception(); } catch (NuGenHL7Exception) { throw new Exception(); } return ret; }