Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.goof.object

Class EM_GOOF_ROTATABLE


Direct ancestors

EM_GOOF_OBJECT, DOUBLE_MATH

Known direct descendants

EM_GOOF_XY_VEHICLE

Creation

Features

Invariants

indexing

description

An rotatable EM_GOOF_OBJECT like a car or ship.

date

$Date: 2005/10/23 12:02:23 $

revision

$Revision: 1.11 $

class

EM_GOOF_ROTATABLE

inherit

EM_GOOF_OBJECT
DOUBLE_MATH
MATH_CONST

create

make (img: EM_DRAWABLE x: DOUBLE y: DOUBLE phs: EM_GOOF_PHYSICS)

-- Make goof_object

-- (From EM_GOOF_OBJECT)

require
image_not_void: img /= void
phs_not_void: phs /= void
make_multiple_picture (imgs: DS_LINKED_LIST[EM_DRAWABLE] x: DOUBLE y: DOUBLE phs: EM_GOOF_PHYSICS)

-- Make with multiple picture for rotation

require
has_images: imgs /= void and then imgs.count > 0
phs_not_void: phs /= void

feature -- Initialization

make (img: EM_DRAWABLE x: DOUBLE y: DOUBLE phs: EM_GOOF_PHYSICS)

-- Make goof_object

-- (From EM_GOOF_OBJECT)

require
image_not_void: img /= void
phs_not_void: phs /= void
make_multiple_picture (imgs: DS_LINKED_LIST[EM_DRAWABLE] x: DOUBLE y: DOUBLE phs: EM_GOOF_PHYSICS)

-- Make with multiple picture for rotation

require
has_images: imgs /= void and then imgs.count > 0
phs_not_void: phs /= void
premake

-- Premake 'rotatable'
-- Must be followed by a real 'make' (or 'make_multiple_picture' in case of rotatable)

-- (From EM_GOOF_OBJECT)

feature -- Access

arc_cosine (v: DOUBLE): DOUBLE

-- Trigonometric arccosine of radian v
-- in the range [0, pi]

-- (From DOUBLE_MATH)

arc_sine (v: DOUBLE): DOUBLE

-- Trigonometric arcsine of radian v
-- in the range [-pi/2, +pi/2]

-- (From DOUBLE_MATH)

arc_tangent (v: DOUBLE): DOUBLE

-- Trigonometric arctangent of radian v
-- in the range [-pi/2, +pi/2]

-- (From DOUBLE_MATH)

ceiling (v: DOUBLE): DOUBLE

-- Least integral greater than or equal to v

-- (From DOUBLE_MATH)

cosine (v: DOUBLE): DOUBLE

-- Trigonometric cosine of radian v approximated
-- in the range [-pi/4, +pi/4]

-- (From DOUBLE_MATH)

dabs (v: DOUBLE): DOUBLE

-- Absolute of v

-- (From DOUBLE_MATH)

exp (x: DOUBLE): DOUBLE

-- Exponential of v.

-- (From DOUBLE_MATH)

floor (v: DOUBLE): DOUBLE

-- Greatest integral less than or equal to v

-- (From DOUBLE_MATH)

log (v: DOUBLE): DOUBLE

-- Natural logarithm of v

-- (From DOUBLE_MATH)

log10 (v: DOUBLE): DOUBLE

-- Base 10 logarithm of v

-- (From DOUBLE_MATH)

log_2 (v: DOUBLE): DOUBLE

-- Base 2 logarithm of v

-- (From DOUBLE_MATH)

sine (v: DOUBLE): DOUBLE

-- Trigonometric sine of radian v approximated
-- in range [-pi/4, +pi/4]

-- (From DOUBLE_MATH)

sqrt (v: DOUBLE): DOUBLE

-- Square root of v

-- (From DOUBLE_MATH)

tangent (v: DOUBLE): DOUBLE

-- Trigonometric tangent of radian v approximated
-- in range [-pi/4, +pi/4]

-- (From DOUBLE_MATH)

feature {EM_GOOF_OBJECT, EM_GOOF_PHYSICS} -- Drawing

draw (screen: EM_VIDEO_SURFACE at: EM_VECTOR_2D at_angle: DOUBLE)

-- draw the object

-- (From EM_GOOF_OBJECT)

require
not_premade: not premade
is_screen: screen /= void

feature -- Properties

arc: DOUBLE

-- Current arc

has_multiple_pictures: BOOLEAN

-- Are there multiple pictures for rotation

image: EM_DRAWABLE

-- Image of this object

-- (From EM_GOOF_OBJECT)

image_position: EM_VECTOR_2D

-- Image positiion correcture (typically= -height/2, -width/2)

-- (From EM_GOOF_OBJECT)

images: DS_LINKED_LIST[EM_DRAWABLE]

-- Multiple images for rotation

physics: EM_GOOF_PHYSICS

-- Physics 'parent'

-- (From EM_GOOF_OBJECT)

position: EM_VECTOR_2D

-- Current position

-- (From EM_GOOF_OBJECT)

premade: BOOLEAN

-- Is this 'object' premade and not yet really made

-- (From EM_GOOF_OBJECT)

set_arc (a_arc: DOUBLE)

-- Set arc

ensure
arc_set: arc = a_arc
visible: BOOLEAN

-- Is this object visible?

-- (From EM_GOOF_OBJECT)

feature {EM_GOOF_OBJECT, EM_GOOF_PHYSICS} -- Processing

process (time_length: DOUBLE)

-- Process this object

-- (From EM_GOOF_OBJECT)

require
not_premade: not premade

invariant

has_images: has_multiple_pictures implies (images /= void and then images.count > 0)

has_image: premade or image /= void
has_position: premade or position /= void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end