25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

UnitAnimation.java 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. }