public virtual void LogEvent(hostChar ch, campCampaign camp, string n, string nl, string desc) { hostUserEvent ev = new hostUserEvent(n, nl, this, ch, camp, desc); ev.DateOccured = DateTime.Now; //this.Events.Add(ev); }
public hostUserEvent(string n, string nl, hostUser usr, hostChar ch, campCampaign camp, string desc) : this(n, nl) { this.Character = ch; this.Campaign = camp; this.Description = desc; this.User = usr; }
private void bs_hostCampaign_CurrentChanged(object sender, EventArgs e) { campCampaign camp = bs_hostCampaign.Current as campCampaign; if (camp != null) { bs_nwCharCampaign.DataSource = sess.QueryOver <campCharCampaign>() .Where(tx => tx.Campaign == camp) .List(); bs_nwAdventure.DataSource = sess.QueryOver <campAdventure>() .Where(tx => tx.Campaign == camp) .List(); LoadCharacters(); } }
private void btnNewAdventure_Click(object sender, EventArgs e) { campCampaign camp = bs_hostCampaign.Current as campCampaign; if (camp == null) { SetMessage("Cannot Add Adventure - No Current campaign"); } else { campAdventure nwa = bs_nwAdventure.AddNew() as campAdventure; camp.Adventures.Add(nwa); nwa.Campaign = camp; tboxAdventureName.Focus(); } }
private void btnDelete_Click(object sender, EventArgs e) { campCampaign cm = bs_hostCampaign.Current as campCampaign; //Flush Pending changes SetMessage("Delete called on " + cm.LongName); btnSave_Click(null, null); SetMessage("Deleting:" + cm.LongName); using (sess.BeginTransaction()) { sess.Delete(cm); sess.Transaction.Commit(); SetMessage("Deleted " + cm.LongName + "lets see whats happened to the characters"); } SetMessage("Reloading List"); LoadCampaigns(); }
private void btnPlayerSelect_Click(object sender, EventArgs e) { bool bExists; //health check campAdventure nw = bs_nwAdventure.Current as campAdventure; if (nw == null) { SetMessage("No Current Adventure"); return; } campCampaign camp = nw.Campaign; if (camp == null) { SetMessage("No Campaign for Adventure:" + nw.LongName); return; } //create Campaign Characters List IList <hostChar> plist = new List <hostChar>(); foreach (campCharCampaign c in camp.Characters) { if (c.Character.isNPC == false && c.Approved) { // Remove if already rewarded / in Adventure bExists = false; foreach (campXPGained xp in nw.Rewards) { if (xp.Character == c.Character) { bExists = true; SetMessage("Skipping " + c.Character.LongName + " exists already"); } } //doesnt exist, isnt NPC, is approved if (!bExists) { plist.Add(c.Character); } } } SetMessage("Loaded" + plist.Count().ToString() + " Campaign Characters"); frmSelectPlayers frmPlayers = new frmSelectPlayers(); frmPlayers.Players = plist; frmPlayers.ShowDialog(this); plist = frmPlayers.Players; frmPlayers.Dispose(); SetMessage("Select returned" + plist.Count().ToString() + " Campaign Characters"); //Create new records for new players foreach (hostChar c in plist) { campXPGained xp = new campXPGained("", "", nw, c, 0, 0, false); nw.Rewards.Add(xp); } //refresh charlist binding bs_nwAdventure_CurrentChanged(null, null); }