Repository navigation
Expand file tree
/
Copy pathGamingInfo.java
More file actions
121 lines (94 loc) · 2.46 KB
/
Copy pathGamingInfo.java
File metadata and controls
121 lines (94 loc) · 2.46 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package com.mypro.model;
import java.util.ArrayList;
import com.mypro.mainsurface.MainSurface;
import com.mypro.manager.ShoalManager;
//import com.mypro.manager.SoundManager;
import com.mypro.model.fish.Fish;
//游戏进行中一些需要共用的变量
public class GamingInfo {
private int screenWidth;
private int screenHeight;
private static GamingInfo gameInfo; // 单例模式需要
private boolean isGaming; // 是否处于游戏状态
private boolean isPause;//是否处于暂停状态
private MainSurface surface; // 主屏幕
private ArrayList<Fish> fish = new ArrayList<Fish>(); // 所有的鱼
private ShoalManager shoalManager; // 鱼群管理器
private float cannonLayoutX; //大炮旋转X坐标
private float cannonLayoutY; //大炮旋转Y坐标
private int score = 100; //当前的分
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
/**
* 清除GamingInfo实例
*/
public static void clearGameInfo() {
gameInfo = null;
}
private GamingInfo() {
}
public static GamingInfo getGamingInfo() {
if (gameInfo == null) {
gameInfo = new GamingInfo();
}
return gameInfo;
}
public boolean isGaming() {
return isGaming;
}
public void setGaming(boolean isGaming) {
this.isGaming = isGaming;
}
public ArrayList<Fish> getFish() {
return fish;
}
public void setFish(ArrayList<Fish> fish) {
this.fish = fish;
}
public MainSurface getSurface() {
return surface;
}
public void setSurface(MainSurface surface) {
this.surface = surface;
}
public ShoalManager getShoalManager() {
return shoalManager;
}
public void setShoalManager(ShoalManager shoalManager) {
this.shoalManager = shoalManager;
}
public int getScreenWidth() {
return screenWidth;
}
public void setScreenWidth(int screenWidth) {
this.screenWidth = screenWidth;
}
public int getScreenHeight() {
return screenHeight;
}
public void setScreenHeight(int screenHeight) {
this.screenHeight = screenHeight;
}
public float getCannonLayoutX() {
return cannonLayoutX;
}
public void setCannonLayoutX(float cannonLayoutX) {
this.cannonLayoutX = cannonLayoutX;
}
public float getCannonLayoutY() {
return cannonLayoutY;
}
public void setCannonLayoutY(float cannonLayoutY) {
this.cannonLayoutY = cannonLayoutY;
}
public boolean isPause() {
return isPause;
}
public void setPause(boolean isPause) {
this.isPause = isPause;
}
}