Example #1
0
        public override Option <IntVec3> OutputCell(ThingDef def, IntVec3 center, IntVec2 size, Map map, Rot4 rot)
        {
            IntVec3 defaultCell = IntVec3.Zero;

            if (def.GetModExtension <ModExtension_Puller>()?.outputSides ?? false)
            {
                defaultCell = center + rot.RotateAsNew(RotationDirection.Counterclockwise).FacingCell;
            }
            else
            {
                defaultCell = center + rot.FacingCell;
            }

            return(Option(base.OutputCell(def, center, size, map, rot).GetOrDefault(defaultCell)));
        }
 public IntVec3 GetOutputCell(IntVec3 pos, Rot4 rot, bool is_right = false)
 {
     if (outputSides)
     {
         RotationDirection dir = RotationDirection.Clockwise;
         if (!is_right)
         {
             dir = RotationDirection.Counterclockwise;
         }
         return(pos + rot.RotateAsNew(dir).FacingCell);
     }
     else
     {
         return(pos + rot.FacingCell);
     }
 }