Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

EnsureShipIsAlive.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  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. Ship.java
  13. Part of the Spacewar system.
  14. */
  15. package spacewar;
  16. /**
  17. * This aspect makes sure that the ship is alive before performing any console
  18. * commands.
  19. *
  20. */
  21. aspect EnsureShipIsAlive {
  22. void around (Ship ship): Ship.helmCommandsCut(ship) {
  23. if ( ship.isAlive() ) {
  24. proceed(ship);
  25. }
  26. }
  27. }