-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScene.java
More file actions
52 lines (43 loc) · 1.03 KB
/
Copy pathScene.java
File metadata and controls
52 lines (43 loc) · 1.03 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
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dimaer on 20/03/17.
* La classe Scene rappresenta il contenitore di oggetti che devono essere disegnati
*
*/
public class Scene {
private List<Drawable> elements;
SCENE_TYPE sceneType;
public enum SCENE_TYPE {
MAIN_MENU,OPTIONS,STATS,RUNNED_GAME
}
/**
* Costruisce il contenitore
* @param sceneType il tipo di scena
*/
public Scene(SCENE_TYPE sceneType)
{
this.sceneType = sceneType;
elements = new ArrayList<Drawable>();
}
/**
* Metodo che torna il tipo di scena
* @return SCENES il tipo di scena
*/
public SCENE_TYPE getSceneType()
{
return sceneType;
}
/**
* Disegna tutti i elementi che stanno dentro il contenitore
* @param graphics l'oggetto che si occupa di operazioni grafiche
*/
public void draw(Graphics graphics)
{
for(Drawable d : elements)
{
d.draw(graphics);
}
}
}