summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java
blob: 9ea6c169a321cb739c74f73a25c2114bfbf4ad00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition;

import com.fourisland.fourpuzzle.Game;

/**
 * SwitchPrecondition checks to see if a certain Switch is ON.
 *
 * @author hatkirby
 */
public class SwitchPrecondition implements Precondition {
    
    private String switchID;
    
    public SwitchPrecondition(String switchID)
    {
        this.switchID = switchID;
    }
    
    public boolean match() 
    {
        return (Game.getSaveFile().getSwitches().containsKey(switchID) && Game.getSaveFile().getSwitches().get(switchID));
    }

}