You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

58 lines
1.1 KiB

  1. package structures.basic;
  2. /**
  3. * This contains information for playing a Unit's animation, e.g.
  4. * move, attack, or idle. One of these animations as a start and
  5. * end index in the animation frames array, an fps (indicating animation
  6. * speed) and whether that animation should loop (e.g. move does, attack
  7. * does not).
  8. *
  9. * @author Dr. Richard McCreadie
  10. *
  11. */
  12. public class UnitAnimation {
  13. int[] frameStartEndIndices;
  14. int fps;
  15. boolean loop;
  16. public UnitAnimation() {}
  17. public UnitAnimation(int[] frameStartEndIndices, int fps, boolean loop) {
  18. super();
  19. this.frameStartEndIndices = frameStartEndIndices;
  20. this.fps = fps;
  21. this.loop = loop;
  22. }
  23. public int[] getFrameStartEndIndices() {
  24. return frameStartEndIndices;
  25. }
  26. public void setFrameStartEndIndices(int[] frameStartEndIndices) {
  27. this.frameStartEndIndices = frameStartEndIndices;
  28. }
  29. public int getFps() {
  30. return fps;
  31. }
  32. public void setFps(int fps) {
  33. this.fps = fps;
  34. }
  35. public boolean isLoop() {
  36. return loop;
  37. }
  38. public void setLoop(boolean loop) {
  39. this.loop = loop;
  40. };
  41. }