% File "terrain.tu". % % Written by Phil Edmonds, Feb 97. % % Terrain is an abstract kind of object. No instance in the system % should actually be in this class, because it has no initialization % also defines a few functions that return properties of the different % types of terrain. % %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ unit class Terrain inherit Object in "object.tu" import SimVar in "simvar.tu" export Size, EnergyFromEating, MoveResistance %========== CONSTANTS ======================================= %============================================================ % all terrain pieces have the same dimensions const Size : int := SimVar.W_TERRAIN_SIZE %========== PUBLIC FUNCTIONS ================================ %============================================================ deferred function EnergyFromEating : int deferred function MoveResistance : real % draws a box (same for all types of terrain body proc DrawImage Draw.FillBox (round (loc -> GetX), round (loc -> GetY), round (loc -> GetX) + Size - 1, round (loc -> GetY) + Size - 1, col) end DrawImage end Terrain