diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-12-03 04:35:46 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-12-03 04:35:46 +0000 |
commit | 9a708b9cf70ef3e0fcc298db2a53cecbca808227 (patch) | |
tree | 134b7f7c9c0d04dd65805777aabee7df1ed5928e /ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java | |
parent | 0ad31dcca37df9891ed5d5b70f12a966fc821c6d (diff) | |
download | uni-9a708b9cf70ef3e0fcc298db2a53cecbca808227.tar uni-9a708b9cf70ef3e0fcc298db2a53cecbca808227.tar.gz uni-9a708b9cf70ef3e0fcc298db2a53cecbca808227.tar.bz2 uni-9a708b9cf70ef3e0fcc298db2a53cecbca808227.tar.xz uni-9a708b9cf70ef3e0fcc298db2a53cecbca808227.zip |
Cleanup
Diffstat (limited to 'ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java')
-rw-r--r-- | ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java b/ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java deleted file mode 100644 index a7c6ad6..0000000 --- a/ws2015/eip/blaetter/07/de/lmu/tcs/Zelle.java +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | package de.lmu.tcs; | ||
2 | |||
3 | /** | ||
4 | * Model | ||
5 | * | ||
6 | * Immutable | ||
7 | * | ||
8 | * Created by jost on 24.11.15. | ||
9 | */ | ||
10 | public class Zelle { | ||
11 | |||
12 | public final static int TOT=0; | ||
13 | public final static int LEBENDIG=1; | ||
14 | |||
15 | private final Position position; | ||
16 | private final int zustand; | ||
17 | |||
18 | public Zelle(Position position, int zustand) { | ||
19 | this.position = position; | ||
20 | this.zustand = zustand; | ||
21 | } | ||
22 | |||
23 | public Zelle(Zelle old) { | ||
24 | this.position = old.position; | ||
25 | this.zustand = old.zustand; | ||
26 | } | ||
27 | |||
28 | public Position getPosition() { | ||
29 | return position; | ||
30 | } | ||
31 | |||
32 | public boolean istLebendig() { | ||
33 | return zustand>=LEBENDIG; | ||
34 | } | ||
35 | |||
36 | public boolean istTot() { | ||
37 | return zustand==TOT; | ||
38 | } | ||
39 | |||
40 | public Zelle nachkommen() { | ||
41 | return this.istTot() ? (new Zelle(this)) : (new Zelle(position, zustand + 1)); | ||
42 | } | ||
43 | |||
44 | public int alter() { | ||
45 | return this.istTot() ? -1 : (this.zustand - 1); | ||
46 | } | ||
47 | } | ||