Ejemplo n.º 1
0
 public void Nortify_UnLinked(Building_LinkableDoor other)
 {
     if (this.linkData.Any())
     {
         this.linkData = CheckAround();
     }
 }
Ejemplo n.º 2
0
 public void Nortify_Linked(Building_LinkableDoor other, int type)
 {
     if (!this.linkData.Any())
     {
         this.linkData.linkedDoors.Add(other);
         this.linkData.linkType = type;
     }
 }
 private static void CheckAround(ILinkData newObj, Func func)
 {
     for (int i = 0; i < 4; i++)
     {
         IntVec3 pos = newObj.Pos + GenAdj.CardinalDirections[i];
         foreach (var thing in newObj.Map.thingGrid.ThingsListAtFast(pos))
         {
             Building_LinkableDoor door    = thing as Building_LinkableDoor;
             ILinkData             current = door?.TryGetComp <CompLinkable>();
             if (current != null)
             {
                 func(i, current);
             }
         }
     }
 }
Ejemplo n.º 4
0
        private LinkData CheckAround()
        {
            LinkData result = new LinkData();

            for (int i = 0; i < 4; i++)
            {
                IntVec3 pos = base.Position + GenAdj.CardinalDirections[i];
                Building_LinkableDoor door = base.Map.thingGrid.ThingAt(pos, base.def) as Building_LinkableDoor;
                if (door != null && door.CanLinkFromOther)
                {
                    result.linkType = ((i + 2) % 4);
                    result.linkedDoors.Add(door);
                    door.Nortify_Linked(this, i);
                    break;
                }
            }
            return(result);
        }
Ejemplo n.º 5
0
 public LinkData(Building_LinkableDoor other, int type)
 {
     this.linkedDoors.Add(other);
     this.linkType = type;
 }