protected override void OnSpawn()
 {
     base.OnSpawn();
     smi = new Controller.Instance(this);
     smi.StartSM();
     UpdateStoredItemState();
 }
Exemplo n.º 2
0
 protected override void OnSpawn()
 {
     base.OnSpawn();
     smi = new Controller.Instance(this);
     smi.StartSM();
     UpdateStoredItemState();
     Subscribe((int)GameHashes.RefreshUserMenu, OnRefreshUserMenuDelegate);
 }
Exemplo n.º 3
0
 protected override void OnSpawn()
 {
     base.OnSpawn();
     storedAmount = storage.MassStored();
     base.Subscribe((int)GameHashes.RefreshUserMenu, new Action <object>(OnRefreshUserMenuDelegate));
     smi = new Controller.Instance(this);
     smi.StartSM();
     UpdateStoredItemState();
 }
Exemplo n.º 4
0
        protected override void OnSpawn()
        {
            base.OnSpawn();

            flutterable.Listening = false;

            controller = new Controller.Instance(this);
            controller.StartSM();

            flutterable.controller = controller;

            // Change heat exchange extents
            HandleVector <int> .Handle  handle = GameComps.StructureTemperatures.GetHandle(gameObject);
            StructureTemperaturePayload data   = GameComps.StructureTemperatures.GetPayload(handle);

            data.OverrideExtents(new Extents((int)transform.position.x - 1, (int)transform.position.y, 3, 2));
            GameComps.StructureTemperatures.SetPayload(handle, ref data);

            SetDefaultCellFlags();
            UpdateState();
            RequestedState = CurrentState;
            ApplyRequestedControlState();
        }
    protected override void OnSpawn()
    {
        base.OnSpawn();
        KPrefabID component = GetComponent <KPrefabID>();

        if ((Object)component != (Object)null)
        {
            log = new LoggerFSS("Door", 35);
        }
        if (!allowAutoControl && controlState == ControlState.Auto)
        {
            controlState = ControlState.Locked;
        }
        StructureTemperatureComponents structureTemperatures = GameComps.StructureTemperatures;

        HandleVector <int> .Handle handle = structureTemperatures.GetHandle(base.gameObject);
        if (DisplacesGas(doorType))
        {
            structureTemperatures.Bypass(handle);
        }
        controller = new Controller.Instance(this);
        controller.StartSM();
        if (doorType == DoorType.Sealed && !hasBeenUnsealed)
        {
            Seal();
        }
        UpdateDoorSpeed(operational.IsOperational);
        Subscribe(-592767678, OnOperationalChangedDelegate);
        Subscribe(824508782, OnOperationalChangedDelegate);
        Subscribe(-801688580, OnLogicValueChangedDelegate);
        requestedState = CurrentState;
        ApplyRequestedControlState(true);
        int num  = (rotatable.GetOrientation() == Orientation.Neutral) ? (building.Def.WidthInCells * (building.Def.HeightInCells - 1)) : 0;
        int num2 = (rotatable.GetOrientation() != 0) ? building.Def.HeightInCells : building.Def.WidthInCells;

        for (int i = 0; i != num2; i++)
        {
            int num3 = building.PlacementCells[num + i];
            Grid.FakeFloor[num3] = true;
            Pathfinding.Instance.AddDirtyNavGridCell(num3);
        }
        List <int> list = new List <int>();

        int[] placementCells = building.PlacementCells;
        foreach (int num4 in placementCells)
        {
            Grid.HasDoor[num4]       = true;
            Grid.HasAccessDoor[num4] = ((Object)GetComponent <AccessControl>() != (Object)null);
            if (rotatable.IsRotated)
            {
                list.Add(Grid.CellAbove(num4));
                list.Add(Grid.CellBelow(num4));
            }
            else
            {
                list.Add(Grid.CellLeft(num4));
                list.Add(Grid.CellRight(num4));
            }
            SimMessages.SetCellProperties(num4, 8);
            if (DisplacesGas(doorType))
            {
                Grid.RenderedByWorld[num4] = false;
            }
        }
    }