示例#1
0
 public Suspect()
 {
     this.CrimeNumber = 0;
     this.LastCrime   = null;
     this.IfWife      = false;
     this.IfChildren  = false;
     this.LastSeen    = null;
     this.Crimes      = new Dictionary <Crime, DateTime>();
     this.SearchedIn  = null;
     History          = new StoryCollection();
 }
示例#2
0
 public static Cursor SetPointerCursor(StoryCollection Collection, Point Location)
 {
     foreach (Story History in Collection)
     {
         if (Location.X > History.Location.X - 5 && Location.X < History.Location.X + 5 && Location.Y > History.Location.Y - 5 && Location.Y < History.Location.Y + 5)
         {
             return(Cursors.Hand);
         }
     }
     return(Cursors.Arrow);
 }
示例#3
0
 public static void FillStory(Point Location, DataGridView Table, StoryCollection Collection)
 {
     Table.Rows.Clear();
     foreach (Story History in Collection)
     {
         if (Location.X > History.Location.X - 5 && Location.X < History.Location.X + 5 && Location.Y > History.Location.Y - 5 && Location.Y < History.Location.Y + 5)
         {
             Table.Rows.Add(History.RetrieveData());
         }
     }
 }
示例#4
0
        public void Draw(Graphics Graphic, StoryCollection Collection)
        {
            GraphicsPath Path     = new GraphicsPath();
            SolidBrush   brush    = new SolidBrush(Color.Blue);
            Point        pos1     = new Point();
            Point        pos2     = new Point();
            bool         todelete = false;

            if (Collection.Count == 1)
            {
                Collection.Add(Collection.ElementAt(0));
                todelete = true;
            }
            for (int i = 0; i < Collection.Count - 1; i++)
            {
                pos1 = new Point();
                pos2 = new Point();
                bool breaker = false;
                foreach (KeyValuePair <string, Point> comparer in Cities)
                {
                    if (Collection.ElementAt(i).State == comparer.Key)
                    {
                        pos1 = comparer.Value;
                        Collection.ElementAt(i).Location = comparer.Value;
                    }
                    if (Collection.ElementAt(i + 1).State == comparer.Key)
                    {
                        pos2 = comparer.Value;
                    }
                    if (Collection.ElementAt(i).State == comparer.Key && Collection.ElementAt(i + 1).State == comparer.Key)
                    {
                        breaker = true;
                        break;
                    }
                }
                if (breaker)
                {
                    continue;
                }
                Path.AddLine(pos1, pos2);
                Path.AddEllipse(pos1.X - 5, pos1.Y - 5, 10, 10);
                Graphic.FillEllipse(brush, pos1.X - 5, pos1.Y - 5, 10, 10);
            }
            Collection.ElementAt(Collection.Count - 1).Location = pos2;
            Path.AddEllipse(pos2.X - 5, pos2.Y - 5, 10, 10);
            Graphic.FillEllipse(brush, pos2.X - 5, pos2.Y - 5, 10, 10);
            Graphic.DrawPath(new Pen(Color.Black, 2), Path);
            if (todelete)
            {
                Collection.Remove(Collection.ElementAt(Collection.Count - 1));
            }
        }
示例#5
0
 public Suspect(string Data)
 {
     History = new StoryCollection();
     Char[]   a       = new Char[] { '~' };
     string[] alldata = Data.Split(a);
     this.PhysData    = new HumanPhysData(alldata[0], alldata[1], alldata[2], Methods.CreateDate(alldata[3]), alldata[4], alldata[5], alldata[6], alldata[7], Convert.ToInt32(alldata[8]));
     this.CrimeNumber = Convert.ToInt32(alldata[9]);
     this.LastCrime   = Methods.SetCrime(alldata[10], '>');
     this.IfWife      = Convert.ToBoolean(alldata[11]);
     this.IfChildren  = Convert.ToBoolean(alldata[12]);
     this.LastSeen    = alldata[13];
     this.Crimes      = CreateDictionary(alldata[14]);
     this.SearchedIn  = alldata[15];
     this.Status      = alldata[16];
     this.PicLoc      = alldata[17];
     History.FillCollection(alldata[18]);
 }