/*---------------------------------------------------------------------------- * Klasse: Hindernis.java * Beschreibung: Superclass aller Bahnelemente * Autor: Jack Meyer * Datum: November, 1997 * --------------------------------------------------------------------------- */ import java.awt.*; abstract class Hindernis { /* * Position des Hindernis. */ protected Point position; /* * Grösse des Hindernis. */ protected Point size; /* * allgemeiner Konstruktor */ protected Hindernis (int x, int y, int w, int h) { position = new Point (x,y); size = new Point (w,h); }; /* * position und Size setzen */ protected void setPos (int x, int y) {position.x = x; position.y = y;}; protected void setSize (int w, int h) {size.x = w; size.y = h;}; /* * Jede Subklasse muss eine Draw() methode haben -> abstract */ abstract void draw (Graphics g, int posX, int posY); };