Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
GameLevel.java
Go to the documentation of this file.
1 // This file is part of MicropolisJ.
2 // Copyright (C) 2013 Jason Long
3 // Portions Copyright (C) 1989-2007 Electronic Arts Inc.
4 //
5 // MicropolisJ is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU GPLv3, with additional terms.
7 // See the README file, included in this distribution, for details.
8 
9 package micropolisj.engine;
10 
11 public class GameLevel
12 {
13  public static final int MIN_LEVEL = 0;
14  public static final int MAX_LEVEL = 2;
15 
16  public static boolean isValid(int lev)
17  {
18  return lev >= MIN_LEVEL && lev <= MAX_LEVEL;
19  }
20 
21  public static int getStartingFunds(int lev)
22  {
23  switch (lev) {
24  case 0: return 20000;
25  case 1: return 10000;
26  case 2: return 5000;
27  default:
28  throw new Error("unexpected game level: "+lev);
29  }
30  }
31 
32  //prevent this class from being instantiated
33  private GameLevel() {}
34 }