Пример #1
0
        private void FixNearItems(TypeItem ImpassibleType, TypeItem typeself)
        {
            List <ItemDistanceTo> nearFixedList = new List <ItemDistanceTo>();

            foreach (var near in NearItems)
            {
                Ray FromMainToFix = new Ray(CurrentPoint, near.CurrentItem.CurrentPoint);
                if ((typeself.Sequence.items != null && typeself.Sequence.Cross(FromMainToFix, false)) || (ImpassibleType != null && ImpassibleType.Sequence.Cross(FromMainToFix, false)))
                {
                    nearFixedList.Add(near);
                }
                else
                {
                    foreach (var near2 in NearItems)
                    {
                        foreach (var type in near2.CurrentItem.Types)
                        {
                            if (type.Sequence.Cross(FromMainToFix, false))
                            {
                                nearFixedList.Add(near);
                                break;
                            }
                        }
                    }
                }
            }
            DifferenceNears(nearFixedList);
        }
Пример #2
0
 public Item(Point point, Form1 form, TypeItem type)
 {
     ID           = _id++;
     CurrentPoint = point;
     _form        = form;
     Types.Add(type);
     CreatePanel();
     //FindNearItems(allItems);
 }
Пример #3
0
 public Item(List <Item> allItems, Form1 form, Point point, TypeItem type, TypeItem ImpassibleType = null)
 {
     ID            = _id++;
     CurrentPoint  = point;
     CurrentCircle = new Circle(point, 40);
     _form         = form;
     Types.Add(type);
     CreatePanel();
     FindNearItems(allItems);
     FixNearItems(ImpassibleType, type);
 }
Пример #4
0
 public override bool Equals(Object type)
 {
     if ((type == null) || !this.GetType().Equals(type.GetType()))
     {
         return(false);
     }
     else
     {
         TypeItem p = (TypeItem)type;
         return(this.Name == p.Name && this.Sequence.Equals(p.Sequence));
     }
 }
Пример #5
0
 public ImpossibleItem(List <Item> allItems, Form1 form, TypeItem generalType, TypeItem typeInner, TypeItem typeOuter) : base(generalType.Sequence.items[generalType.Sequence.items.Count - 2].CurrentPoint)
 {
     itemInner = new Item(allItems, form, TakePoint(generalType.Sequence.items, true), typeInner, generalType);
     itemOuter = new Item(allItems, form, TakePoint(generalType.Sequence.items, false), typeOuter, generalType);
 }