Exemplo n.º 1
0
    public void Sim1000ms(float dt)
    {
        mingleCells.Clear();
        RoomProber        roomProber        = Game.Instance.roomProber;
        MinionGroupProber minionGroupProber = MinionGroupProber.Get();

        foreach (Room room in roomProber.rooms)
        {
            if (room.roomType == Db.Get().RoomTypes.RecRoom)
            {
                for (int i = room.cavity.minY; i <= room.cavity.maxY; i++)
                {
                    for (int j = room.cavity.minX; j <= room.cavity.maxX; j++)
                    {
                        int        num           = Grid.XYToCell(j, i);
                        CavityInfo cavityForCell = roomProber.GetCavityForCell(num);
                        if (cavityForCell == room.cavity && minionGroupProber.IsReachable(num) && !Grid.HasLadder[num] && !Grid.HasTube[num] && !Grid.IsLiquid(num) && Grid.Element[num].id == SimHashes.Oxygen)
                        {
                            mingleCells.Add(num);
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 private static void PrefixRoomProbe(RoomProber __instance)
 {
     foreach (int cell in ROOMS_PENDING)
     {
         var cavity = __instance.GetCavityForCell(cell);
         if (cavity != null)
         {
             __instance.UpdateRoom(cavity);
         }
         else
         {
             __instance.SolidChangedEvent(cell, true);
         }
     }
     ROOMS_PENDING.Clear();
 }