InputProvider.java 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package me.hammerle.snuviscript.inputprovider;
  2. import me.hammerle.snuviscript.code.Script;
  3. public abstract class InputProvider
  4. {
  5. public Object get(Script sc)
  6. {
  7. throw new ClassCastException();
  8. }
  9. public byte getByte(Script sc)
  10. {
  11. return (byte) getDouble(sc);
  12. }
  13. public short getShort(Script sc)
  14. {
  15. return (short) getDouble(sc);
  16. }
  17. public int getInt(Script sc)
  18. {
  19. return (int) getDouble(sc);
  20. }
  21. public long getLong(Script sc)
  22. {
  23. return (long) getDouble(sc);
  24. }
  25. public float getFloat(Script sc)
  26. {
  27. return (float) getDouble(sc);
  28. }
  29. public double getDouble(Script sc)
  30. {
  31. throw new ClassCastException();
  32. }
  33. public String getString(Script sc)
  34. {
  35. throw new ClassCastException();
  36. }
  37. public boolean getBoolean(Script sc)
  38. {
  39. throw new ClassCastException();
  40. }
  41. public void set(Script sc, Object o)
  42. {
  43. throw new ClassCastException();
  44. }
  45. }