Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
Speed.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 
17 public enum Speed
18 {
19  PAUSED ( 999, 0),
20  SLOW ( 625, 1), //one sim step every 1250 ms
21  NORMAL ( 125, 1), //one sim step every 250 ms
22  FAST ( 25, 1), //one sim step every 50 ms
23  SUPER_FAST( 25, 5); //one sim step every 10 ms
24 
26  public final int animationDelay;
27 
30  public final int simStepsPerUpdate;
31 
32  private Speed(int delay, int simSteps)
33  {
34  this.animationDelay = delay;
35  this.simStepsPerUpdate = simSteps;
36  }
37 
38  public int getAnimationsPerSecond() {
39  return 1000 / animationDelay;
40  }
41 }