Example #1
0
        //public Artifact(NameValueCollection data, World world)
        //    : base (data, world)
        //{
        //    Name = data["Name"].ToString();
        //}

        public override void Select(MainForm frm)
        {
            frm.grpArtifact.Text = ToString();
            frm.grpArtifact.Show();

            frm.lblArtifactName.Text = Name;
            frm.lblArtifactItem.Text = Item;


            frm.grpArtifactCreated.Visible = CreatedEvent != null;
            if (CreatedEvent != null)
            {
                frm.lblArtifactCreatedBy.Data   = CreatedEvent.HistFigure;
                frm.lblArtifactCreatedSite.Data = CreatedEvent.Site;
                frm.lblArtifactCreatedTime.Data = CreatedEvent;
                frm.lblArtifactCreatedTime.Text = CreatedEvent.Time.ToString();
            }

            frm.grpArtifactLost.Visible = LostEvent != null;
            if (LostEvent != null)
            {
                frm.lblArtifactLostSite.Data = LostEvent.Site;
                frm.lblArtifactLostTime.Data = LostEvent;
                frm.lblArtifactLostTime.Text = LostEvent.Time.ToString();
            }

            frm.grpArtifactStored.Visible = StoredEvents != null;
            if (StoredEvents != null)
            {
                frm.lstArtifactStored.Items.Clear();
                foreach (var evt in StoredEvents)
                {
                    frm.lstArtifactStored.Items.Add(evt);
                }
                frm.lstArtifactStored.SelectedIndex = 0;
            }

            frm.grpArtifactPossessed.Visible = PossessedEvents != null;
            if (PossessedEvents != null)
            {
                frm.lstArtifactPossessed.Items.Clear();
                foreach (var evt in PossessedEvents)
                {
                    frm.lstArtifactPossessed.Items.Add(evt);
                }
                frm.lstArtifactPossessed.SelectedIndex = 0;
            }

            frm.lstArtifactKills.Items.Clear();
            if (Kills != null)
            {
                frm.lstArtifactKills.Items.AddRange(Kills.ToArray());
            }
            frm.grpArtifactKills.Visible = frm.lstArtifactKills.Items.Count > 0;

            Program.MakeSelected(frm.tabArtifact, frm.lstArtifact, this);
        }