Example #1
0
    public void TriggerToggle(Puzzle puzzle, PuzzleState state)
    {
        PuzzleTriggerElement e = element as PuzzleTriggerElement;

        e.SetValue(puzzle, state, !(bool)e.GetValue(puzzle, state));
        foreach (PuzzleReceiverElement receiver in receiverElements)
        {
            receiver.ToggleValue(puzzle, state);
        }
    }
Example #2
0
    public void TriggerValue(Puzzle puzzle, PuzzleState state, bool value)
    {
        PuzzleTriggerElement e = element as PuzzleTriggerElement;

        if (e.GetValue(puzzle, state) == value)
        {
            return;
        }
        e.SetValue(puzzle, state, value);
        foreach (PuzzleReceiverElement receiver in receiverElements)
        {
            receiver.SetValue(puzzle, state, value);
        }
    }