diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-03-20 09:30:10 -0400 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-03-20 09:30:10 -0400 |
commit | af19fd5898d839e1976f34960b21f8dfc2dd77eb (patch) | |
tree | d3b48831b7c41bdacd8ed9f1cc304b20d284cacd /src/com | |
parent | fc3afd1d6460b2aa453167498979bbf7a636ef45 (diff) | |
download | fourpuzzle-af19fd5898d839e1976f34960b21f8dfc2dd77eb.tar.gz fourpuzzle-af19fd5898d839e1976f34960b21f8dfc2dd77eb.tar.bz2 fourpuzzle-af19fd5898d839e1976f34960b21f8dfc2dd77eb.zip |
Engine: Added ChangeFrequencyMoveEvent
Closes #17
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/ChangeFrequencyMoveEvent.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/ChangeFrequencyMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/ChangeFrequencyMoveEvent.java new file mode 100644 index 0000000..58117a5 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/ChangeFrequencyMoveEvent.java | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove; | ||
7 | |||
8 | import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; | ||
9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.LayerEvent; | ||
10 | |||
11 | /** | ||
12 | * ChangeFrequencyMoveEvent changes the walk frequency of an event; in other | ||
13 | * words, it changes how how often this event will initiate movement. The event | ||
14 | * must be a LayerEvent and the frequency must be larger than or equal to 1. | ||
15 | * | ||
16 | * @author hatkirby | ||
17 | */ | ||
18 | public class ChangeFrequencyMoveEvent implements MoveEvent { | ||
19 | |||
20 | private int freq; | ||
21 | public ChangeFrequencyMoveEvent(int freq) | ||
22 | { | ||
23 | this.freq = freq; | ||
24 | } | ||
25 | |||
26 | public void doAction(Event ev) | ||
27 | { | ||
28 | if (!(ev instanceof LayerEvent)) | ||
29 | { | ||
30 | throw new IllegalArgumentException(""); | ||
31 | } | ||
32 | |||
33 | ((LayerEvent) ev).setFrequency(freq); | ||
34 | } | ||
35 | |||
36 | } | ||