Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Pilot.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Copyright (c) Xerox Corporation 1998-2002. All rights reserved.
  3. Use and copying of this software and preparation of derivative works based
  4. upon this software are permitted. Any distribution of this software or
  5. derivative works must comply with all applicable United States export control
  6. laws.
  7. This software is made available AS IS, and Xerox Corporation makes no warranty
  8. about the software, its performance or its conformity to any specification.
  9. |<--- this code is formatted to fit into 80 columns --->|
  10. |<--- this code is formatted to fit into 80 columns --->|
  11. |<--- this code is formatted to fit into 80 columns --->|
  12. */
  13. package spacewar;
  14. /**
  15. * Pilot is the abstract superclass of Player and Robot.
  16. *
  17. */
  18. abstract class Pilot {
  19. private Game game;
  20. private int number;
  21. protected Ship ship = null;
  22. Game getGame() { return game; }
  23. int getNumber() { return number; }
  24. Ship getShip() { return ship; }
  25. void setShip(Ship s) { ship = s; }
  26. Pilot (Game g, int n) {
  27. super();
  28. game = g;
  29. number = n;
  30. }
  31. }