/[eiffelstudio]/branches/eth/eve/Src/examples/Eiffel2JavaScript/circles/circle.e
ViewVC logotype

Contents of /branches/eth/eve/Src/examples/Eiffel2JavaScript/circles/circle.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 86166 - (show annotations)
Fri Apr 8 11:40:41 2011 UTC (8 years, 6 months ago) by adima
File size: 854 byte(s)
JavaScript compiler:
- Removed UI code from the ``circles'' example, now it represent the model
- Added ``circles_vision2'' and ``circles_javascript'', two examples which use ``circles'' to show code reuse

1 note
2 description : "A circle."
3 author : "Alexandru Dima <alex.dima@gmail.com>"
4 copyright : "Copyright (C) 2011, Alexandru Dima"
5 date : "$Date$"
6 revision : "$Revision$"
7
8 class
9 CIRCLE
10
11 inherit
12 DOUBLE_MATH
13
14 create
15 make
16
17 feature {NONE} -- Initialization
18
19 make (a_position: attached VECTOR; a_radius: DOUBLE; a_color: attached COLOR)
20 -- Initialize
21 do
22 position := a_position
23 radius := a_radius
24 mass := Pi * radius * radius
25 color := a_color
26 create velocity.make (0, 0.001 * mass)
27 end
28
29 feature -- Access
30
31 color: attached COLOR
32
33 position: attached VECTOR assign set_position
34 set_position (a_position: attached VECTOR)
35 do
36 position := a_position
37 end
38
39 velocity: attached VECTOR assign set_velocity
40 set_velocity (a_velocity: attached VECTOR)
41 do
42 velocity := a_velocity
43 end
44
45 radius, mass: DOUBLE
46
47 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23