home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / oberon / system / kepler5.mod (.txt) < prev    next >
Oberon Text  |  1977-12-31  |  3KB  |  82 lines

  1. Syntax10.Scn.Fnt
  2. MODULE Kepler5;    (* J. Templ 4.4.91 *)
  3. IMPORT KeplerGraphs, KeplerFrames, KeplerPorts, Oberon, Display;
  4.     FocusStar* = POINTER TO StarDesc;
  5.     StarDesc* = RECORD
  6.         (KeplerGraphs.ConsDesc)
  7.     END ;
  8.     FocusStar2* = POINTER TO StarDesc2;
  9.     StarDesc2* = RECORD
  10.         (KeplerGraphs.ConsDesc)
  11.     END ;
  12.     SelStar* = POINTER TO SelStarDesc;
  13.     SelStarDesc* = RECORD
  14.         (KeplerGraphs.ConsDesc)
  15.     END ;
  16.     Planet* = POINTER TO PlanetDesc;
  17.     PlanetDesc* = RECORD
  18.         (KeplerGraphs.ConsDesc)
  19.     END ;
  20. (* ------------------------------- FocusStar ------------------------------- *)
  21.     PROCEDURE (self: FocusStar) Draw* (F: KeplerPorts.Port);
  22.         VAR x, y: INTEGER;
  23.     BEGIN
  24.         x := self.p[0].x - 8; y := self.p[0].y - 8;
  25.         F.DrawLine(x, y, x + 16, y + 16, Display.white, Display.replace);
  26.         F.DrawLine(x, y + 16, x + 16, y, Display.white, Display.replace)
  27.     END Draw;
  28.     PROCEDURE NewFocusStar*;
  29.         VAR o: FocusStar;
  30.     BEGIN
  31.         IF KeplerFrames.nofpts > 0 THEN
  32.             NEW(o); o.nofpts := 1;
  33.             KeplerFrames.ConsumePoint(o.p[0]);
  34.             KeplerFrames.Focus.Append(o);
  35.         END
  36.     END NewFocusStar;
  37. (* ------------------------------- FocusStar2 ------------------------------- *)
  38.     PROCEDURE (self: FocusStar2) Draw* (F: KeplerPorts.Port);
  39.         VAR x, y: INTEGER;
  40.     BEGIN x := self.p[0].x; y := self.p[0].y;
  41.         F.DrawLine(x - 16, y, x + 16, y, Display.white, Display.replace);
  42.         F.DrawLine(x, y + 16, x, y - 16, Display.white, Display.replace)
  43.     END Draw;
  44.     PROCEDURE NewFocusStar2*;
  45.         VAR o: FocusStar2;
  46.     BEGIN
  47.         IF KeplerFrames.nofpts > 0 THEN
  48.             NEW(o); o.nofpts := 1;
  49.             KeplerFrames.ConsumePoint(o.p[0]);
  50.             KeplerFrames.Focus.Append(o);
  51.         END
  52.     END NewFocusStar2;
  53. (* ------------------------------- SelStar ------------------------------- *)
  54.     PROCEDURE (self: SelStar) Draw* (F: KeplerPorts.Port);
  55.     BEGIN
  56.         F.FillRect(self.p[0].x - 12, self.p[0].y - 12, 28, 28, Display.white, 5, Display.replace)
  57.     END Draw;
  58.     PROCEDURE NewSelStar*;
  59.         VAR o: SelStar;
  60.     BEGIN
  61.         IF KeplerFrames.nofpts > 0 THEN
  62.             NEW(o); o.nofpts := 1;
  63.             KeplerFrames.ConsumePoint(o.p[0]);
  64.             KeplerFrames.Focus.Append(o);
  65.         END
  66.     END NewSelStar;
  67. (* ------------------------------- Planet ------------------------------- *)
  68.     PROCEDURE (self: Planet) Draw* (F: KeplerPorts.Port);
  69.     BEGIN
  70.         F.DrawRect(self.p[0].x - 12, self.p[0].y - 12, 24, 24, Display.white, Display.replace)
  71.     END Draw;
  72.     PROCEDURE NewPlanet*;
  73.         VAR o: Planet;
  74.     BEGIN
  75.         IF KeplerFrames.nofpts > 0 THEN
  76.             NEW(o); o.nofpts := 1;
  77.             KeplerFrames.ConsumePoint(o.p[0]);
  78.             KeplerFrames.Focus.Append(o);
  79.         END
  80.     END NewPlanet;
  81. END Kepler5.
  82.