public void deregisterCompHideFromPlayerPosition(CompHideFromPlayer comp, int x, int z)
 {
     if (x >= 0 && z >= 0 && x < mapSizeX && z < mapSizeZ)
     {
         compHideFromPlayerGrid[(z * mapSizeX) + x].Remove(comp);
     }
 }
 public void deregisterCompHideFromPlayerPosition(CompHideFromPlayer comp, int x, int z)
 {
     if (x >= 0 && z >= 0 && x < mapSizeX && z < mapSizeZ)
     {
         int idx = (z * mapSizeX) + x;
         compHideFromPlayerGrid[idx].Remove(comp);
         compHideFromPlayerGridCount[idx]--;
     }
 }
        private void performSetup()
        {
            if (!setup)
            {
                setup = true;

                // Init sub-components.
                ThingCategory thingCategory = parent.def.category;

                compComponentsPositionTracker               = new CompComponentsPositionTracker();
                compComponentsPositionTracker.parent        = parent;
                compComponentsPositionTracker.mainComponent = this;

                compHiddenable               = new CompHiddenable();
                compHiddenable.parent        = parent;
                compHiddenable.mainComponent = this;

                compHideFromPlayer               = new CompHideFromPlayer();
                compHideFromPlayer.parent        = parent;
                compHideFromPlayer.mainComponent = this;

                if (thingCategory == ThingCategory.Building)
                {
                    compViewBlockerWatcher               = new CompViewBlockerWatcher();
                    compViewBlockerWatcher.parent        = parent;
                    compViewBlockerWatcher.mainComponent = this;
                }
                if (thingCategory == ThingCategory.Pawn ||
                    thingCategory == ThingCategory.Building)
                {
                    compFieldOfViewWatcher               = new CompFieldOfViewWatcher();
                    compFieldOfViewWatcher.parent        = parent;
                    compFieldOfViewWatcher.mainComponent = this;
                }
            }
        }