ion « event « mapview « gamestate « fourpuzzle « fourisland « com « src - fourpuzzle - RPG/Puzzle game engine written in Java
summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java
blob: ae8183de72dd7dfd85ea3bc3ff260bac8291ffc9 (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
30
/*
 * 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;

/**
 *
 * @author hatkirby
 */
public class HeroLevelPrecondition implements Precondition {

    private String heroName;
    private int level;
    
    public HeroLevelPrecondition(String heroName, int level)
    {
        this.heroName = heroName;
        this.level = level;
    }
    
    public boolean match()
    {
        return (Game.getSaveFile().getParty().exists(heroName) && (Game.getSaveFile().getParty().get(heroName).getLevel() == level));
    }
    
}