mirror of
https://github.com/guezoloic/L3-racing-game.git
synced 2026-03-29 03:23:44 +00:00
feat: ajout impl Car et rework State et Game
This commit is contained in:
@@ -5,35 +5,35 @@ public class State
|
||||
// <CARBURANT PERDU> <PREMIER INTERVAL> <SECOND INTERVAL>
|
||||
NORMAL(2, 1, 6);
|
||||
|
||||
private int carbUsed;
|
||||
private int[] interval;
|
||||
public int carbUsed;
|
||||
public int[] interval;
|
||||
|
||||
private DriveMode(int carbUsed, int fInterval, int sInterval)
|
||||
{
|
||||
this.carbUsed = carbUsed;
|
||||
interval = new int[] {fInterval, sInterval};
|
||||
}
|
||||
|
||||
public int getConsumption()
|
||||
{
|
||||
return carbUsed;
|
||||
}
|
||||
|
||||
public int[] getInterval()
|
||||
{
|
||||
return interval;
|
||||
this.carbUsed = carbUsed;
|
||||
interval = new int[] {fInterval, sInterval};
|
||||
}
|
||||
}
|
||||
|
||||
private static DriveMode current = DriveMode.NORMAL;
|
||||
private DriveMode current = DriveMode.NORMAL;
|
||||
|
||||
public static DriveMode get()
|
||||
{
|
||||
return current;
|
||||
}
|
||||
public DriveMode get()
|
||||
{
|
||||
return current;
|
||||
}
|
||||
|
||||
public static void set(DriveMode DriveMode)
|
||||
{
|
||||
current = DriveMode;
|
||||
}
|
||||
public int[] getInterval()
|
||||
{
|
||||
return current.interval;
|
||||
}
|
||||
|
||||
public int getConsumption()
|
||||
{
|
||||
return current.carbUsed;
|
||||
}
|
||||
|
||||
public void set(DriveMode DriveMode)
|
||||
{
|
||||
current = DriveMode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user