zyps 0.5.2 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/README.txt +18 -0
  2. data/bin/zyps +13 -9
  3. data/bin/zyps_demo +3 -0
  4. data/bin/zyps_server +262 -0
  5. data/doc/classes/Zyps.html +161 -0
  6. data/doc/classes/Zyps/AccelerateAction.html +200 -0
  7. data/doc/classes/Zyps/AccelerateAction.src/M000020.html +19 -0
  8. data/doc/classes/Zyps/AccelerateAction.src/M000021.html +19 -0
  9. data/doc/classes/Zyps/AccelerateAction.src/M000022.html +18 -0
  10. data/doc/classes/Zyps/Accelerator.html +181 -0
  11. data/doc/classes/Zyps/Accelerator.src/M000044.html +19 -0
  12. data/doc/classes/Zyps/Accelerator.src/M000045.html +18 -0
  13. data/doc/classes/Zyps/Action.html +217 -0
  14. data/doc/classes/Zyps/Action.src/M000014.html +18 -0
  15. data/doc/classes/Zyps/Action.src/M000015.html +18 -0
  16. data/doc/classes/Zyps/Action.src/M000016.html +17 -0
  17. data/doc/classes/Zyps/Action.src/M000017.html +18 -0
  18. data/doc/classes/Zyps/AgeCondition.html +181 -0
  19. data/doc/classes/Zyps/AgeCondition.src/M000058.html +18 -0
  20. data/doc/classes/Zyps/AgeCondition.src/M000059.html +18 -0
  21. data/doc/classes/Zyps/ApproachAction.html +207 -0
  22. data/doc/classes/Zyps/ApproachAction.src/M000074.html +19 -0
  23. data/doc/classes/Zyps/ApproachAction.src/M000075.html +19 -0
  24. data/doc/classes/Zyps/ApproachAction.src/M000076.html +38 -0
  25. data/doc/classes/Zyps/Behavior.html +206 -0
  26. data/doc/classes/Zyps/Behavior.src/M000012.html +20 -0
  27. data/doc/classes/Zyps/Behavior.src/M000013.html +31 -0
  28. data/doc/classes/Zyps/BlendAction.html +181 -0
  29. data/doc/classes/Zyps/BlendAction.src/M000066.html +18 -0
  30. data/doc/classes/Zyps/BlendAction.src/M000067.html +18 -0
  31. data/doc/classes/Zyps/Clock.html +180 -0
  32. data/doc/classes/Zyps/Clock.src/M000069.html +18 -0
  33. data/doc/classes/Zyps/Clock.src/M000070.html +21 -0
  34. data/doc/classes/Zyps/Clock.src/M000071.html +18 -0
  35. data/doc/classes/Zyps/CollisionCondition.html +148 -0
  36. data/doc/classes/Zyps/CollisionCondition.src/M000083.html +18 -0
  37. data/doc/classes/Zyps/Color.html +299 -0
  38. data/doc/classes/Zyps/Color.src/M000038.html +18 -0
  39. data/doc/classes/Zyps/Color.src/M000039.html +16 -0
  40. data/doc/classes/Zyps/Color.src/M000040.html +16 -0
  41. data/doc/classes/Zyps/Color.src/M000041.html +16 -0
  42. data/doc/classes/Zyps/Color.src/M000042.html +18 -0
  43. data/doc/classes/Zyps/Color.src/M000043.html +22 -0
  44. data/doc/classes/Zyps/Condition.html +118 -0
  45. data/doc/classes/Zyps/Creature.html +190 -0
  46. data/doc/classes/Zyps/Creature.src/M000025.html +19 -0
  47. data/doc/classes/Zyps/Creature.src/M000026.html +18 -0
  48. data/doc/classes/Zyps/DestroyAction.html +181 -0
  49. data/doc/classes/Zyps/DestroyAction.src/M000054.html +18 -0
  50. data/doc/classes/Zyps/DestroyAction.src/M000055.html +20 -0
  51. data/doc/classes/Zyps/EatAction.html +149 -0
  52. data/doc/classes/Zyps/EatAction.src/M000068.html +21 -0
  53. data/doc/classes/Zyps/Enclosure.html +206 -0
  54. data/doc/classes/Zyps/Enclosure.src/M000010.html +18 -0
  55. data/doc/classes/Zyps/Enclosure.src/M000011.html +31 -0
  56. data/doc/classes/Zyps/Environment.html +203 -0
  57. data/doc/classes/Zyps/Environment.src/M000081.html +19 -0
  58. data/doc/classes/Zyps/Environment.src/M000082.html +67 -0
  59. data/doc/classes/Zyps/EnvironmentalFactor.html +118 -0
  60. data/doc/classes/Zyps/FaceAction.html +148 -0
  61. data/doc/classes/Zyps/FaceAction.src/M000080.html +18 -0
  62. data/doc/classes/Zyps/FleeAction.html +207 -0
  63. data/doc/classes/Zyps/FleeAction.src/M000084.html +19 -0
  64. data/doc/classes/Zyps/FleeAction.src/M000085.html +19 -0
  65. data/doc/classes/Zyps/FleeAction.src/M000086.html +38 -0
  66. data/doc/classes/Zyps/Friction.html +181 -0
  67. data/doc/classes/Zyps/Friction.src/M000072.html +19 -0
  68. data/doc/classes/Zyps/Friction.src/M000073.html +18 -0
  69. data/doc/classes/Zyps/GameObject.html +282 -0
  70. data/doc/classes/Zyps/GameObject.src/M000060.html +19 -0
  71. data/doc/classes/Zyps/GameObject.src/M000061.html +16 -0
  72. data/doc/classes/Zyps/GameObject.src/M000062.html +19 -0
  73. data/doc/classes/Zyps/GameObject.src/M000063.html +16 -0
  74. data/doc/classes/Zyps/GameObject.src/M000064.html +16 -0
  75. data/doc/classes/Zyps/Gravity.html +145 -0
  76. data/doc/classes/Zyps/Gravity.src/M000065.html +16 -0
  77. data/doc/classes/Zyps/Location.html +167 -0
  78. data/doc/classes/Zyps/Location.src/M000037.html +18 -0
  79. data/doc/classes/Zyps/NoMatchException.html +111 -0
  80. data/doc/classes/Zyps/PopulationLimit.html +183 -0
  81. data/doc/classes/Zyps/PopulationLimit.src/M000027.html +19 -0
  82. data/doc/classes/Zyps/PopulationLimit.src/M000028.html +20 -0
  83. data/doc/classes/Zyps/ProximityCondition.html +182 -0
  84. data/doc/classes/Zyps/ProximityCondition.src/M000056.html +18 -0
  85. data/doc/classes/Zyps/ProximityCondition.src/M000057.html +18 -0
  86. data/doc/classes/Zyps/PullAction.html +199 -0
  87. data/doc/classes/Zyps/PullAction.src/M000046.html +19 -0
  88. data/doc/classes/Zyps/PullAction.src/M000047.html +19 -0
  89. data/doc/classes/Zyps/PullAction.src/M000048.html +23 -0
  90. data/doc/classes/Zyps/PushAction.html +199 -0
  91. data/doc/classes/Zyps/PushAction.src/M000049.html +19 -0
  92. data/doc/classes/Zyps/PushAction.src/M000050.html +19 -0
  93. data/doc/classes/Zyps/PushAction.src/M000051.html +23 -0
  94. data/doc/classes/Zyps/SpeedLimit.html +181 -0
  95. data/doc/classes/Zyps/SpeedLimit.src/M000023.html +18 -0
  96. data/doc/classes/Zyps/SpeedLimit.src/M000024.html +18 -0
  97. data/doc/classes/Zyps/TagAction.html +181 -0
  98. data/doc/classes/Zyps/TagAction.src/M000052.html +18 -0
  99. data/doc/classes/Zyps/TagAction.src/M000053.html +18 -0
  100. data/doc/classes/Zyps/TagCondition.html +181 -0
  101. data/doc/classes/Zyps/TagCondition.src/M000018.html +18 -0
  102. data/doc/classes/Zyps/TagCondition.src/M000019.html +18 -0
  103. data/doc/classes/Zyps/TrailsView.html +209 -0
  104. data/doc/classes/Zyps/TrailsView.src/M000008.html +40 -0
  105. data/doc/classes/Zyps/TrailsView.src/M000009.html +78 -0
  106. data/doc/classes/Zyps/TurnAction.html +200 -0
  107. data/doc/classes/Zyps/TurnAction.src/M000077.html +19 -0
  108. data/doc/classes/Zyps/TurnAction.src/M000078.html +19 -0
  109. data/doc/classes/Zyps/TurnAction.src/M000079.html +18 -0
  110. data/doc/classes/Zyps/Utility.html +251 -0
  111. data/doc/classes/Zyps/Utility.src/M000001.html +26 -0
  112. data/doc/classes/Zyps/Utility.src/M000002.html +22 -0
  113. data/doc/classes/Zyps/Utility.src/M000003.html +18 -0
  114. data/doc/classes/Zyps/Utility.src/M000004.html +21 -0
  115. data/doc/classes/Zyps/Utility.src/M000005.html +25 -0
  116. data/doc/classes/Zyps/Utility.src/M000006.html +21 -0
  117. data/doc/classes/Zyps/Utility.src/M000007.html +21 -0
  118. data/doc/classes/Zyps/Vector.html +281 -0
  119. data/doc/classes/Zyps/Vector.src/M000029.html +19 -0
  120. data/doc/classes/Zyps/Vector.src/M000030.html +16 -0
  121. data/doc/classes/Zyps/Vector.src/M000031.html +21 -0
  122. data/doc/classes/Zyps/Vector.src/M000032.html +16 -0
  123. data/doc/classes/Zyps/Vector.src/M000033.html +18 -0
  124. data/doc/classes/Zyps/Vector.src/M000034.html +16 -0
  125. data/doc/classes/Zyps/Vector.src/M000035.html +18 -0
  126. data/doc/classes/Zyps/Vector.src/M000036.html +25 -0
  127. data/doc/created.rid +1 -0
  128. data/doc/files/COPYING_LESSER_txt.html +311 -0
  129. data/doc/files/COPYING_txt.html +1003 -0
  130. data/doc/files/README_txt.html +236 -0
  131. data/doc/files/lib/zyps/actions_rb.html +134 -0
  132. data/doc/files/lib/zyps/conditions_rb.html +134 -0
  133. data/doc/files/lib/zyps/environmental_factors_rb.html +134 -0
  134. data/doc/files/lib/zyps/views/trails_rb.html +134 -0
  135. data/doc/files/lib/zyps_rb.html +134 -0
  136. data/doc/fr_class_index.html +62 -0
  137. data/doc/fr_file_index.html +34 -0
  138. data/doc/fr_method_index.html +112 -0
  139. data/doc/index.html +24 -0
  140. data/doc/rdoc-style.css +208 -0
  141. data/lib/zyps.rb +40 -9
  142. data/lib/zyps/actions.rb +8 -1
  143. data/lib/zyps/conditions.rb +6 -0
  144. data/lib/zyps/environmental_factors.rb +74 -0
  145. data/lib/zyps/views/trails.rb +6 -0
  146. data/test/test_zyps.rb +3 -0
  147. data/test/zyps/test_actions.rb +3 -0
  148. data/test/zyps/test_conditions.rb +3 -0
  149. data/test/zyps/test_environmental_factors.rb +90 -7
  150. metadata +185 -9
@@ -0,0 +1,34 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Files
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Files</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Files</h1>
22
+ <div id="index-entries">
23
+ <a href="files/COPYING_LESSER_txt.html">COPYING.LESSER.txt</a><br />
24
+ <a href="files/COPYING_txt.html">COPYING.txt</a><br />
25
+ <a href="files/README_txt.html">README.txt</a><br />
26
+ <a href="files/lib/zyps_rb.html">lib/zyps.rb</a><br />
27
+ <a href="files/lib/zyps/actions_rb.html">lib/zyps/actions.rb</a><br />
28
+ <a href="files/lib/zyps/conditions_rb.html">lib/zyps/conditions.rb</a><br />
29
+ <a href="files/lib/zyps/environmental_factors_rb.html">lib/zyps/environmental_factors.rb</a><br />
30
+ <a href="files/lib/zyps/views/trails_rb.html">lib/zyps/views/trails.rb</a><br />
31
+ </div>
32
+ </div>
33
+ </body>
34
+ </html>
@@ -0,0 +1,112 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Methods
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Methods</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Methods</h1>
22
+ <div id="index-entries">
23
+ <a href="classes/Zyps/Vector.html#M000036">+ (Zyps::Vector)</a><br />
24
+ <a href="classes/Zyps/Color.html#M000043">+ (Zyps::Color)</a><br />
25
+ <a href="classes/Zyps/Color.html#M000042"><=> (Zyps::Color)</a><br />
26
+ <a href="classes/Zyps/Friction.html#M000073">act (Zyps::Friction)</a><br />
27
+ <a href="classes/Zyps/Creature.html#M000026">act (Zyps::Creature)</a><br />
28
+ <a href="classes/Zyps/SpeedLimit.html#M000024">act (Zyps::SpeedLimit)</a><br />
29
+ <a href="classes/Zyps/Accelerator.html#M000045">act (Zyps::Accelerator)</a><br />
30
+ <a href="classes/Zyps/Enclosure.html#M000011">act (Zyps::Enclosure)</a><br />
31
+ <a href="classes/Zyps/PopulationLimit.html#M000028">act (Zyps::PopulationLimit)</a><br />
32
+ <a href="classes/Zyps/GameObject.html#M000063">age (Zyps::GameObject)</a><br />
33
+ <a href="classes/Zyps/GameObject.html#M000064">age= (Zyps::GameObject)</a><br />
34
+ <a href="classes/Zyps/Color.html#M000041">blue= (Zyps::Color)</a><br />
35
+ <a href="classes/Zyps/Utility.html#M000007">collided? (Zyps::Utility)</a><br />
36
+ <a href="classes/Zyps/Utility.html#M000005">constrain_value (Zyps::Utility)</a><br />
37
+ <a href="classes/Zyps/PullAction.html#M000048">do (Zyps::PullAction)</a><br />
38
+ <a href="classes/Zyps/Action.html#M000016">do (Zyps::Action)</a><br />
39
+ <a href="classes/Zyps/TagAction.html#M000053">do (Zyps::TagAction)</a><br />
40
+ <a href="classes/Zyps/PushAction.html#M000051">do (Zyps::PushAction)</a><br />
41
+ <a href="classes/Zyps/DestroyAction.html#M000055">do (Zyps::DestroyAction)</a><br />
42
+ <a href="classes/Zyps/FleeAction.html#M000086">do (Zyps::FleeAction)</a><br />
43
+ <a href="classes/Zyps/BlendAction.html#M000067">do (Zyps::BlendAction)</a><br />
44
+ <a href="classes/Zyps/FaceAction.html#M000080">do (Zyps::FaceAction)</a><br />
45
+ <a href="classes/Zyps/ApproachAction.html#M000076">do (Zyps::ApproachAction)</a><br />
46
+ <a href="classes/Zyps/TurnAction.html#M000079">do (Zyps::TurnAction)</a><br />
47
+ <a href="classes/Zyps/EatAction.html#M000068">do (Zyps::EatAction)</a><br />
48
+ <a href="classes/Zyps/AccelerateAction.html#M000022">do (Zyps::AccelerateAction)</a><br />
49
+ <a href="classes/Zyps/Clock.html#M000070">elapsed_time (Zyps::Clock)</a><br />
50
+ <a href="classes/Zyps/Utility.html#M000001">find_angle (Zyps::Utility)</a><br />
51
+ <a href="classes/Zyps/Utility.html#M000002">find_distance (Zyps::Utility)</a><br />
52
+ <a href="classes/Zyps/Utility.html#M000006">find_reflection_angle (Zyps::Utility)</a><br />
53
+ <a href="classes/Zyps/Color.html#M000040">green= (Zyps::Color)</a><br />
54
+ <a href="classes/Zyps/Environment.html#M000082">interact (Zyps::Environment)</a><br />
55
+ <a href="classes/Zyps/AgeCondition.html#M000059">met? (Zyps::AgeCondition)</a><br />
56
+ <a href="classes/Zyps/ProximityCondition.html#M000057">met? (Zyps::ProximityCondition)</a><br />
57
+ <a href="classes/Zyps/TagCondition.html#M000019">met? (Zyps::TagCondition)</a><br />
58
+ <a href="classes/Zyps/CollisionCondition.html#M000083">met? (Zyps::CollisionCondition)</a><br />
59
+ <a href="classes/Zyps/GameObject.html#M000062">move (Zyps::GameObject)</a><br />
60
+ <a href="classes/Zyps/Vector.html#M000029">new (Zyps::Vector)</a><br />
61
+ <a href="classes/Zyps/TurnAction.html#M000077">new (Zyps::TurnAction)</a><br />
62
+ <a href="classes/Zyps/Location.html#M000037">new (Zyps::Location)</a><br />
63
+ <a href="classes/Zyps/Creature.html#M000025">new (Zyps::Creature)</a><br />
64
+ <a href="classes/Zyps/SpeedLimit.html#M000023">new (Zyps::SpeedLimit)</a><br />
65
+ <a href="classes/Zyps/ApproachAction.html#M000074">new (Zyps::ApproachAction)</a><br />
66
+ <a href="classes/Zyps/Accelerator.html#M000044">new (Zyps::Accelerator)</a><br />
67
+ <a href="classes/Zyps/AccelerateAction.html#M000020">new (Zyps::AccelerateAction)</a><br />
68
+ <a href="classes/Zyps/PullAction.html#M000046">new (Zyps::PullAction)</a><br />
69
+ <a href="classes/Zyps/Color.html#M000038">new (Zyps::Color)</a><br />
70
+ <a href="classes/Zyps/PopulationLimit.html#M000027">new (Zyps::PopulationLimit)</a><br />
71
+ <a href="classes/Zyps/PushAction.html#M000049">new (Zyps::PushAction)</a><br />
72
+ <a href="classes/Zyps/Friction.html#M000072">new (Zyps::Friction)</a><br />
73
+ <a href="classes/Zyps/TagCondition.html#M000018">new (Zyps::TagCondition)</a><br />
74
+ <a href="classes/Zyps/TagAction.html#M000052">new (Zyps::TagAction)</a><br />
75
+ <a href="classes/Zyps/TrailsView.html#M000008">new (Zyps::TrailsView)</a><br />
76
+ <a href="classes/Zyps/DestroyAction.html#M000054">new (Zyps::DestroyAction)</a><br />
77
+ <a href="classes/Zyps/Clock.html#M000069">new (Zyps::Clock)</a><br />
78
+ <a href="classes/Zyps/ProximityCondition.html#M000056">new (Zyps::ProximityCondition)</a><br />
79
+ <a href="classes/Zyps/Environment.html#M000081">new (Zyps::Environment)</a><br />
80
+ <a href="classes/Zyps/Behavior.html#M000012">new (Zyps::Behavior)</a><br />
81
+ <a href="classes/Zyps/FleeAction.html#M000084">new (Zyps::FleeAction)</a><br />
82
+ <a href="classes/Zyps/GameObject.html#M000060">new (Zyps::GameObject)</a><br />
83
+ <a href="classes/Zyps/Enclosure.html#M000010">new (Zyps::Enclosure)</a><br />
84
+ <a href="classes/Zyps/Gravity.html#M000065">new (Zyps::Gravity)</a><br />
85
+ <a href="classes/Zyps/Action.html#M000014">new (Zyps::Action)</a><br />
86
+ <a href="classes/Zyps/BlendAction.html#M000066">new (Zyps::BlendAction)</a><br />
87
+ <a href="classes/Zyps/AgeCondition.html#M000058">new (Zyps::AgeCondition)</a><br />
88
+ <a href="classes/Zyps/Behavior.html#M000013">perform (Zyps::Behavior)</a><br />
89
+ <a href="classes/Zyps/Vector.html#M000030">pitch (Zyps::Vector)</a><br />
90
+ <a href="classes/Zyps/Vector.html#M000031">pitch= (Zyps::Vector)</a><br />
91
+ <a href="classes/Zyps/Color.html#M000039">red= (Zyps::Color)</a><br />
92
+ <a href="classes/Zyps/Clock.html#M000071">reset_elapsed_time (Zyps::Clock)</a><br />
93
+ <a href="classes/Zyps/GameObject.html#M000061">size= (Zyps::GameObject)</a><br />
94
+ <a href="classes/Zyps/AccelerateAction.html#M000021">start (Zyps::AccelerateAction)</a><br />
95
+ <a href="classes/Zyps/PullAction.html#M000047">start (Zyps::PullAction)</a><br />
96
+ <a href="classes/Zyps/PushAction.html#M000050">start (Zyps::PushAction)</a><br />
97
+ <a href="classes/Zyps/ApproachAction.html#M000075">start (Zyps::ApproachAction)</a><br />
98
+ <a href="classes/Zyps/FleeAction.html#M000085">start (Zyps::FleeAction)</a><br />
99
+ <a href="classes/Zyps/TurnAction.html#M000078">start (Zyps::TurnAction)</a><br />
100
+ <a href="classes/Zyps/Action.html#M000015">start (Zyps::Action)</a><br />
101
+ <a href="classes/Zyps/Action.html#M000017">stop (Zyps::Action)</a><br />
102
+ <a href="classes/Zyps/Utility.html#M000003">to_degrees (Zyps::Utility)</a><br />
103
+ <a href="classes/Zyps/Utility.html#M000004">to_radians (Zyps::Utility)</a><br />
104
+ <a href="classes/Zyps/TrailsView.html#M000009">update (Zyps::TrailsView)</a><br />
105
+ <a href="classes/Zyps/Vector.html#M000032">x (Zyps::Vector)</a><br />
106
+ <a href="classes/Zyps/Vector.html#M000033">x= (Zyps::Vector)</a><br />
107
+ <a href="classes/Zyps/Vector.html#M000034">y (Zyps::Vector)</a><br />
108
+ <a href="classes/Zyps/Vector.html#M000035">y= (Zyps::Vector)</a><br />
109
+ </div>
110
+ </div>
111
+ </body>
112
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
5
+
6
+ <!--
7
+
8
+ Zyps - A game library for Ruby
9
+
10
+ -->
11
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
12
+ <head>
13
+ <title>Zyps - A game library for Ruby</title>
14
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
15
+ </head>
16
+ <frameset rows="20%, 80%">
17
+ <frameset cols="25%,35%,45%">
18
+ <frame src="fr_file_index.html" title="Files" name="Files" />
19
+ <frame src="fr_class_index.html" name="Classes" />
20
+ <frame src="fr_method_index.html" name="Methods" />
21
+ </frameset>
22
+ <frame src="files/README_txt.html" name="docwin" />
23
+ </frameset>
24
+ </html>
@@ -0,0 +1,208 @@
1
+
2
+ body {
3
+ font-family: Verdana,Arial,Helvetica,sans-serif;
4
+ font-size: 90%;
5
+ margin: 0;
6
+ margin-left: 40px;
7
+ padding: 0;
8
+ background: white;
9
+ }
10
+
11
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
12
+ h1 { font-size: 150%; }
13
+ h2,h3,h4 { margin-top: 1em; }
14
+
15
+ a { background: #eef; color: #039; text-decoration: none; }
16
+ a:hover { background: #039; color: #eef; }
17
+
18
+ /* Override the base stylesheet's Anchor inside a table cell */
19
+ td > a {
20
+ background: transparent;
21
+ color: #039;
22
+ text-decoration: none;
23
+ }
24
+
25
+ /* and inside a section title */
26
+ .section-title > a {
27
+ background: transparent;
28
+ color: #eee;
29
+ text-decoration: none;
30
+ }
31
+
32
+ /* === Structural elements =================================== */
33
+
34
+ div#index {
35
+ margin: 0;
36
+ margin-left: -40px;
37
+ padding: 0;
38
+ font-size: 90%;
39
+ }
40
+
41
+
42
+ div#index a {
43
+ margin-left: 0.7em;
44
+ }
45
+
46
+ div#index .section-bar {
47
+ margin-left: 0px;
48
+ padding-left: 0.7em;
49
+ background: #ccc;
50
+ font-size: small;
51
+ }
52
+
53
+
54
+ div#classHeader, div#fileHeader {
55
+ width: auto;
56
+ color: white;
57
+ padding: 0.5em 1.5em 0.5em 1.5em;
58
+ margin: 0;
59
+ margin-left: -40px;
60
+ border-bottom: 3px solid #006;
61
+ }
62
+
63
+ div#classHeader a, div#fileHeader a {
64
+ background: inherit;
65
+ color: white;
66
+ }
67
+
68
+ div#classHeader td, div#fileHeader td {
69
+ background: inherit;
70
+ color: white;
71
+ }
72
+
73
+
74
+ div#fileHeader {
75
+ background: #057;
76
+ }
77
+
78
+ div#classHeader {
79
+ background: #048;
80
+ }
81
+
82
+
83
+ .class-name-in-header {
84
+ font-size: 180%;
85
+ font-weight: bold;
86
+ }
87
+
88
+
89
+ div#bodyContent {
90
+ padding: 0 1.5em 0 1.5em;
91
+ }
92
+
93
+ div#description {
94
+ padding: 0.5em 1.5em;
95
+ background: #efefef;
96
+ border: 1px dotted #999;
97
+ }
98
+
99
+ div#description h1,h2,h3,h4,h5,h6 {
100
+ color: #125;;
101
+ background: transparent;
102
+ }
103
+
104
+ div#validator-badges {
105
+ text-align: center;
106
+ }
107
+ div#validator-badges img { border: 0; }
108
+
109
+ div#copyright {
110
+ color: #333;
111
+ background: #efefef;
112
+ font: 0.75em sans-serif;
113
+ margin-top: 5em;
114
+ margin-bottom: 0;
115
+ padding: 0.5em 2em;
116
+ }
117
+
118
+
119
+ /* === Classes =================================== */
120
+
121
+ table.header-table {
122
+ color: white;
123
+ font-size: small;
124
+ }
125
+
126
+ .type-note {
127
+ font-size: small;
128
+ color: #DEDEDE;
129
+ }
130
+
131
+ .xxsection-bar {
132
+ background: #eee;
133
+ color: #333;
134
+ padding: 3px;
135
+ }
136
+
137
+ .section-bar {
138
+ color: #333;
139
+ border-bottom: 1px solid #999;
140
+ margin-left: -20px;
141
+ }
142
+
143
+
144
+ .section-title {
145
+ background: #79a;
146
+ color: #eee;
147
+ padding: 3px;
148
+ margin-top: 2em;
149
+ margin-left: -30px;
150
+ border: 1px solid #999;
151
+ }
152
+
153
+ .top-aligned-row { vertical-align: top }
154
+ .bottom-aligned-row { vertical-align: bottom }
155
+
156
+ /* --- Context section classes ----------------------- */
157
+
158
+ .context-row { }
159
+ .context-item-name { font-family: monospace; font-weight: bold; color: black; }
160
+ .context-item-value { font-size: small; color: #448; }
161
+ .context-item-desc { color: #333; padding-left: 2em; }
162
+
163
+ /* --- Method classes -------------------------- */
164
+ .method-detail {
165
+ background: #efefef;
166
+ padding: 0;
167
+ margin-top: 0.5em;
168
+ margin-bottom: 1em;
169
+ border: 1px dotted #ccc;
170
+ }
171
+ .method-heading {
172
+ color: black;
173
+ background: #ccc;
174
+ border-bottom: 1px solid #666;
175
+ padding: 0.2em 0.5em 0 0.5em;
176
+ }
177
+ .method-signature { color: black; background: inherit; }
178
+ .method-name { font-weight: bold; }
179
+ .method-args { font-style: italic; }
180
+ .method-description { padding: 0 0.5em 0 0.5em; }
181
+
182
+ /* --- Source code sections -------------------- */
183
+
184
+ a.source-toggle { font-size: 90%; }
185
+ div.method-source-code {
186
+ background: #262626;
187
+ color: #ffdead;
188
+ margin: 1em;
189
+ padding: 0.5em;
190
+ border: 1px dashed #999;
191
+ overflow: hidden;
192
+ }
193
+
194
+ div.method-source-code pre { color: #ffdead; overflow: hidden; }
195
+
196
+ /* --- Ruby keyword styles --------------------- */
197
+
198
+ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
199
+
200
+ .ruby-constant { color: #7fffd4; background: transparent; }
201
+ .ruby-keyword { color: #00ffff; background: transparent; }
202
+ .ruby-ivar { color: #eedd82; background: transparent; }
203
+ .ruby-operator { color: #00ffee; background: transparent; }
204
+ .ruby-identifier { color: #ffdead; background: transparent; }
205
+ .ruby-node { color: #ffa07a; background: transparent; }
206
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
207
+ .ruby-regexp { color: #ffa07a; background: transparent; }
208
+ .ruby-value { color: #7fffd4; background: transparent; }
data/lib/zyps.rb CHANGED
@@ -18,6 +18,7 @@
18
18
 
19
19
  require 'observer'
20
20
 
21
+ module Zyps
21
22
 
22
23
  #A virtual environment.
23
24
  class Environment
@@ -45,16 +46,41 @@ class Environment
45
46
 
46
47
  objects.each do |object|
47
48
 
49
+
48
50
  #Move each object according to its vector.
49
- object.move(elapsed_time)
51
+ begin
52
+ object.move(elapsed_time)
53
+ #Remove misbehaving objects.
54
+ rescue Exception => exception
55
+ puts exception, exception.backtrace
56
+ objects.delete(object)
57
+ next
58
+ end
50
59
 
51
60
  #Have all environmental factors interact with each object.
52
- environmental_factors.each {|factor| factor.act(object)}
61
+ environmental_factors.each do |factor|
62
+ begin
63
+ factor.act(object)
64
+ #Remove misbehaving environmental factors.
65
+ rescue Exception => exception
66
+ environmental_factors.delete(factor)
67
+ puts exception, exception.backtrace
68
+ next
69
+ end
70
+ end
53
71
 
54
72
  #Have all creatures interact with the environment.
55
73
  if object.respond_to?(:act)
56
- object.act(self)
74
+ begin
75
+ object.act(self)
76
+ #Remove misbehaving objects.
77
+ rescue Exception => exception
78
+ puts exception, exception.backtrace
79
+ objects.delete(object)
80
+ next
81
+ end
57
82
  end
83
+
58
84
 
59
85
  end
60
86
 
@@ -171,7 +197,7 @@ end
171
197
 
172
198
 
173
199
  #A condition for one Creature to act on another.
174
- #Conditions must implement a test(actor, target) instance method.
200
+ #Conditions must implement a met?(actor, target) instance method.
175
201
  class Condition
176
202
  end
177
203
 
@@ -208,7 +234,7 @@ class Behavior
208
234
  action.start(actor, target) unless action.started
209
235
  action.do(actor, target)
210
236
  end
211
- rescue
237
+ rescue NoMatchException => exception
212
238
  #If the behavior can no longer be performed, halt it.
213
239
  stop(actor, target)
214
240
  end
@@ -243,7 +269,7 @@ class Behavior
243
269
  end
244
270
  end
245
271
  #If there were no matches, throw an exception.
246
- raise "No matching targets found."
272
+ raise NoMatchException, "No matching targets found."
247
273
  end
248
274
 
249
275
 
@@ -382,8 +408,8 @@ end
382
408
 
383
409
  #Various methods for working with Vectors, etc.
384
410
  module Utility
385
-
386
- PI2 = Math::PI * 2.0
411
+
412
+ PI2 = Math::PI * 2.0 #:nodoc:
387
413
 
388
414
  #Get the angle (in degrees) from one Location to another.
389
415
  def Utility.find_angle(origin, target)
@@ -448,4 +474,9 @@ module Utility
448
474
  false
449
475
  end
450
476
 
451
- end
477
+ end
478
+
479
+
480
+ class NoMatchException < RuntimeError; end
481
+
482
+ end #module Zyps