public bool Init() { for (int i = 0; i < teamArray.Length; i++) { // { // color = STATIC_TEAM[i].color, // team = STATIC_TEAM[i].team, // iconname = STATIC_TEAM[i].iconname, // teamManager = this //}; CampConfig camp = CampConfigConfigProvider.Instance.GetData(i.ToString()); if (camp != null) { teamArray[i] = new Team(camp); teamArray[i].team = (TEAM)i; teamArray[i].color = camp.campcolor; teamArray[i].teamManager = this; } } Release(); return(true); }
public Team(CampConfig cfg) { mCampConfig = cfg; playerData = new PlayerData(); playerData.Reset(); playerData.currentTeam = this; Clear(); }
public int InsertWallet(Wallet wallet) { int rs = 0; long camppoints = ctx.Wallets.Where(p => p.CampId == wallet.CampId).Sum(p => (long?)p.DailyGetPoints).GetValueOrDefault() + wallet.DailyGetPoints; CampConfig campinfo = ctx.CampConfigs.Where(p => p.CampId == wallet.CampId).Single(); campinfo.CurrentPoints = camppoints; DbEntityEntry <CampConfig> campentry = ctx.Entry(campinfo); campentry.State = EntityState.Modified; ctx.Wallets.Add(wallet); rs = ctx.SaveChanges(); return(rs); }
public int DeleteWallet(Wallet wallet) { int rs = 0; Wallet walletentry = ctx.Wallets.Find(wallet.WId); if (walletentry == null) { return(rs); } long camppoints = ctx.Wallets.Where(p => p.CampId == wallet.CampId).Sum(p => (long?)p.DailyGetPoints).GetValueOrDefault() - wallet.DailyGetPoints; CampConfig campinfo = ctx.CampConfigs.Where(p => p.CampId == wallet.CampId).Single(); campinfo.CurrentPoints = camppoints; DbEntityEntry <CampConfig> campentry = ctx.Entry(campinfo); campentry.State = EntityState.Modified; ctx.Wallets.Remove(walletentry); rs = ctx.SaveChanges(); return(rs); }