DungeonMasterEngine.DungeonContent.Actuators.Wall.LogicTileActivator.ActivateContent C# (CSharp) Method

ActivateContent() public method

public ActivateContent ( LogicTile t ) : void
t DungeonMasterEngine.DungeonContent.Tiles.LogicTile
return void
        public override void ActivateContent(LogicTile t)
        {
            foreach (var gate in t.Gates)
            {
                switch (BitAction)
                {
                    case ActionState.Clear:
                        gate[BitIndex] = false;
                        break;
                    case ActionState.Set:
                        gate[BitIndex] = true;
                        break;
                    case ActionState.Toggle:
                        gate[BitIndex] ^= true;
                        break;
                    case ActionState.Hold:
                        throw new InvalidOperationException();
                }
            }

            foreach (var counter in t.Counters)
            {
                switch (BitAction)
                {
                    case ActionState.Set:
                        counter.Increase();
                        break;
                    case ActionState.Clear:
                    case ActionState.Toggle:
                        counter.Decrease();
                        break;
                    case ActionState.Hold:
                        throw new InvalidOperationException();
                }
            }
        }
    }