public void RegisterPlayer(PlayerMobile pm) { PVPArenaSystem.SendParticipantMessage(this, 1115956); // A new duelist has joined your session! PVPArenaSystem.SendMessage(pm, 1115955); // You have joined the session. if (BattleMode == BattleMode.Team) { if (TeamOrder.Count > TeamChaos.Count) { TeamChaos.AddParticipant(pm); } else { TeamOrder.AddParticipant(pm); } } else { if (Teams[Teams.Count - 1].Unoccupied) { Teams[Teams.Count - 1].AddParticipant(pm); } else { Teams.Add(new ArenaTeam(pm)); } } }
public ActionResult Create([Bind(Include = "TeamId,MemberId,Startdate,Enddate,LeastAmount,Status")] Teambuy teambuy) { if (ModelState.IsValid && Session["LoginMemberId"] != null) { if (teambuy.MemberId == null) { teambuy.MemberId = Session["LoginMemberId"].ToString(); } teambuy.Startdate = DateTime.Now; teambuy.Status = "1"; db.Teambuys.Add(teambuy); db.SaveChanges(); ProductDbContext productDb = new ProductDbContext(); string supplierId = Request["SupplierId"]; foreach (Product product in productDb.Products.Where(m=>m.SupplierId == supplierId).ToList()) { TeamOrder teamOrder = new TeamOrder(); teamOrder.MemberId = Session["LoginMemberId"].ToString(); teamOrder.Quantity = 0; teamOrder.Amount = 0; teamOrder.TeamId = teambuy.TeamId; teamOrder.ProductId = product.ProductId; db.TeamOrders.Add(teamOrder); db.SaveChanges(); } return RedirectToAction("Index"); } return View(teambuy); }
public override Dictionary <string, object> SaveToDict() { var dict = new Dictionary <string, object>(); dict.Add(GDMConstants.SchemaKey, "Hero"); dict.Merge(true, locked.ToGDEDict(lockedKey)); dict.Merge(true, lv.ToGDEDict(lvKey)); dict.Merge(true, status.ToGDEDict(statusKey)); dict.Merge(true, hashCode.ToGDEDict(hashCodeKey)); dict.Merge(true, battleForce.ToGDEDict(battleForceKey)); dict.Merge(true, hpPropAdd.ToGDEDict(hpPropAddKey)); dict.Merge(true, exp.ToGDEDict(expKey)); dict.Merge(true, mpPropAdd.ToGDEDict(mpPropAddKey)); dict.Merge(true, tpPropAdd.ToGDEDict(tpPropAddKey)); dict.Merge(true, starNumUpgradeTimes.ToGDEDict(starNumUpgradeTimesKey)); dict.Merge(true, index.ToGDEDict(indexKey)); dict.Merge(true, wakeNum.ToGDEDict(wakeNumKey)); dict.Merge(true, nameBeforeId.ToGDEDict(nameBeforeIdKey)); dict.Merge(true, Likability.ToGDEDict(LikabilityKey)); dict.Merge(true, teamPos.ToGDEDict(teamPosKey)); dict.Merge(true, likability.ToGDEDict(likabilityKey)); dict.Merge(true, Fatigue.ToGDEDict(FatigueKey)); dict.Merge(true, TeamOrder.ToGDEDict(TeamOrderKey)); dict.Merge(true, sex.ToGDEDict(sexKey)); dict.Merge(true, skillLevel.ToGDEDict(skillLevelKey)); dict.Merge(true, teamIdBelongTo.ToGDEDict(teamIdBelongToKey)); dict.Merge(true, id.ToGDEDict(idKey)); dict.Merge(true, equipHelmet.ToGDEDict(equipHelmetKey)); dict.Merge(true, equipBreastplate.ToGDEDict(equipBreastplateKey)); dict.Merge(true, equipGardebras.ToGDEDict(equipGardebrasKey)); dict.Merge(true, equipLegging.ToGDEDict(equipLeggingKey)); dict.Merge(true, jewelry0.ToGDEDict(jewelry0Key)); dict.Merge(true, jewelry1.ToGDEDict(jewelry1Key)); dict.Merge(true, RoleAttritubeList.ToGDEDict(RoleAttritubeListKey)); dict.Merge(true, equipWeapon.ToGDEDict(equipWeaponKey)); dict.Merge(true, a_skillOmega.ToGDEDict(a_skillOmegaKey)); dict.Merge(true, a_skill0.ToGDEDict(a_skill0Key)); dict.Merge(true, a_skill1.ToGDEDict(a_skill1Key)); dict.Merge(true, ItemInfo.ToGDEDict(ItemInfoKey)); dict.Merge(true, AnimData.ToGDEDict(AnimDataKey)); return(dict); }
public bool SwapParticipant(PlayerMobile pm) { if (HasBegun) { return(false); } if (TeamOrder.RemoveParticipant(pm)) { TeamChaos.AddParticipant(pm); return(true); } else if (TeamChaos.RemoveParticipant(pm)) { TeamOrder.AddParticipant(pm); return(true); } return(false); }