Morph subclass: #DrawCard instanceVariableNames: 'nombre deQuienSoy numero'
classVariableNames: '' poolDictionaries: '' category: 'Morphic-TEG'!
!DrawCard methodsFor: 'initialization' stamp: 'edc 3/27/2006 07:41'!
dibujaUnaCarta: t1
| t2 t3 t4 t5 | self numero: t1. t4 _ #(Soldado1 Canon
Caballo ). t1 > 42 ifTrue: [t3 _ self top + 5. t4 do: [:t6 |
self addMorph: (DrawPicture new initializeWith: t6 escala: 0.7). self
submorphs first center: self center. self submorphs first top: t3. t3
_ t3 + 40]] ifFalse: [t5 _ t1 \\\ 3 + 1. self addMorphBack:
(DrawPicture new initializeWith: (t4 at: t5) valor: t1 pos:
self left + 20 @ self center y). t2 _ StringMorph contents: self nombre.
t2 center: self center. t2 top: self top + 8. self addMorphBack: t2]! !
!DrawCard methodsFor: 'initialization'! initialize super initialize. self
setProperty: #dragEnabled toValue: true. self extent: 80 @ 120. self color:
Color lightGray. self borderColor: Color black. self borderWidth: 2! !
!DrawCard methodsFor: 'initialization'! initializeOff self addMorph: (Form
fromFileNamed: 'TEGCarta.png') asMorph! ! !DrawCard methodsFor:
'initialization'! nombre: t1 limites: t2
| t3 t4 t5 | nombre _ t1. ejEnPais
_ 0. self vertices: t2 asArray color: Color white borderWidth: 2
borderColor: Color black. t4 _ self center. t5 _ Morph new. t5 bounds:
(Rectangle left: t4 x right: t4 x + 15 top: t4 y bottom: t4 y +
10). t5 color: Color white. self addMorph: t5. t3 _ TextMorph new. t3
autoFit: true. t3 string: ejEnPais asString fontName: #ComicBold size: 18
wrap: false. t3 contents: ejEnPais asString. t3 bounds: t5. t3 centered.
self addMorph: t3. t3 lock! !
!DrawCard methodsFor: 'access'! deQuienSoy ^
deQuienSoy! ! !DrawCard methodsFor: 'access'! deQuienSoy: t1
deQuienSoy _ t1!
! !DrawCard methodsFor: 'access'! nombre ^ nombre! ! !DrawCard methodsFor:
'access'! nombre: t1
nombre _ t1! ! !DrawCard methodsFor: 'access'! numero ^
numero! ! !DrawCard methodsFor: 'access'! numero: t1
numero _ t1! !
!DrawCard methodsFor: 'event handling'! click: t1
^ self! ! !DrawCard
methodsFor: 'event handling'! doubleClick: t1
submorphs first ifNil: [^ 0].
submorphs first delete. self dibujaUnaCarta: numero! ! !DrawCard methodsFor:
'event handling'! handlesMouseDown: t1
^ true! ! !DrawCard methodsFor: 'event
handling'! mouseDown: t1
t1 hand waitForClicksOrDrag: self event: t1. t1 hand
grabMorph: self! !
IconicButton subclass: #DrawPicture
instanceVariableNames: 'estado valor' classVariableNames: 'MisDibujos'
poolDictionaries: '' category: 'Morphic-TEG'! !DrawPicture methodsFor: 'as yet
unclassified'! estado ^ estado! ! !DrawPicture methodsFor: 'as yet
unclassified' stamp: 'edc 3/26/2006 09:22'! estado: t1
| t2 | estado := t1.
estado ifTrue: [t2 := submorphs first form. t2 mapColor: Color white to:
Color lightRed] ifFalse: [t2 := submorphs first form. t2 mapColor: Color
lightRed to: Color white]. ! ! !DrawPicture methodsFor: 'as yet unclassified'
stamp: 'edc 10/19/2004 08:29'! initializeWith: t1
self labelGraphic:
(MisDibujos at: t1).! ! !DrawPicture methodsFor: 'as yet unclassified' stamp:
'edc 10/19/2004 16:03'! initializeWith: t1 escala: t2
| t3 | t3 _ MisDibujos
at: t1. t3 _ t3 magnify: t3 boundingBox by: t2. self labelGraphic: t3. self
setSwitchState: false! ! !DrawPicture methodsFor: 'as yet unclassified' stamp:
'edc 10/19/2004 16:10'! initializeWith: t1 valor: t2 pos: t3
| t4 | valor _
t2. self estado: false. t4 _MisDibujos at: t1. self labelGraphic: t4. self
position: t3. self borderNormal! ! !DrawPicture methodsFor: 'as yet
unclassified' stamp: 'edc 3/24/2006 10:14'! initializeWith: t1 valor: t2 rect:
t3
| t4 | valor := t2.
t4 := MisDibujos at: t1. self labelGraphic: t4.
self estado: false. self bounds: t3. self comeToFront! ! !DrawPicture
methodsFor: 'as yet unclassified'! mouseUp: t1
(self containsPoint: t1
cursorPoint) ifTrue: [self setSwitchState: estado = false. self
doButtonAction] ifFalse: [self setSwitchState: estado = true]! ! !DrawPicture
methodsFor: 'as yet unclassified' stamp: 'edc 3/14/2006 12:13'! setSwitchState:
t1
t1 ifTrue: [self borderColor: #inset. self estado: true] ifFalse:
[self borderColor: #raised. self estado: false]. ! ! !DrawPicture
methodsFor: 'as yet unclassified'! valor ^ valor! ! !DrawPicture methodsFor:
'as yet unclassified' stamp: 'edc 3/19/2006 08:22'! webClick: aPoint (self
containsPoint: aPoint ) ifTrue: [self setSwitchState: estado not].! ! "-- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! DrawPicture class
instanceVariableNames: ''! !DrawPicture class methodsFor: 'objects from disk'
stamp: 'edc 5/12/2006 07:59'! inicializarDibujos "DrawPicture inicializarDibujos
Este método se ejecuta una única vez, seleccionando previamente el directorio
donde están los dibujos" | dir oldFolder | oldFolder := FileDirectory default.
dir := UIManager default chooseDirectory. FileDirectory setDefaultDirectory: dir
pathName. MisDibujos _ Dictionary new. MisDibujos at: #Soldado1 put: (Form
fromFileNamed: 'Soldado1.gif'). MisDibujos at: #Soldado5 put: (Form
fromFileNamed: 'Soldado5.gif'). MisDibujos at: #Soldado10 put: (Form
fromFileNamed: 'Soldado10.gif'). MisDibujos at: #Soldado20 put: (Form
fromFileNamed: 'Soldado10.gif'). MisDibujos at: #Soldado50 put: (Form
fromFileNamed: 'Soldado50.gif'). MisDibujos at: #Ok put: (Form
fromFileNamed:'OK.gif'). MisDibujos at: #Cancel put: (Form fromFileNamed:
'Cancel.gif'). MisDibujos at: #Muerte put: (Form fromFileNamed: 'muerte.gif').
MisDibujos at: #Split put: (Form fromFileNamed: 'Split.gif'). MisDibujos at:
#Caballo put: (Form fromFileNamed: 'Caballo.gif'). MisDibujos at: #Canon put:
(Form fromFileNamed: 'Canon.gif'). MisDibujos at: #CardsDLOG put: (Form
fromFileNamed:'CardsDLOG.gif'). FileDirectory setDefaultDirectory: oldFolder
pathName.
! ! !DrawPicture class methodsFor: 'objects from disk' stamp: 'edc
5/6/2006 07:15'! misDibujos " DrawPicture misDibujos" ^MisDibujos ! !
HVTransientView subclass: #HVTEG instanceVariableNames: '' classVariableNames:
'' poolDictionaries: '' category: 'Morphic-TEG'! !HVTEG commentStamp:
'<historical>' prior: 0! HVTEG startDebugOn: 8000
HVTEG stop!
!HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:03'! alaska ^self cualPais:
'Alaska'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:19'! aral ^self
cualPais: 'Aral'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:04'!
argentina ^self cualPais: 'Argentina'
! ! !HVTEG methodsFor: 'urls' stamp:
'edc 3/24/2006 10:05'! ataque self model ataque. ^ self redirectTo: #step! !
!HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton1 | losboton
miboton | losboton := self model botones. miboton := losboton at: 1.
^ self
switchButton: miboton! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
09:27'! boton2 | losboton miboton | losboton := self model botones. miboton
:= losboton at: 2. ^ self switchButton: miboton! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 09:27'! boton3 | losboton miboton | losboton := self
model botones. miboton := losboton at: 3. ^ self switchButton: miboton! !
!HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton4 | losboton
miboton | losboton := self model botones. miboton := losboton at: 4. ^ self
switchButton: miboton! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
09:27'! boton5 | losboton miboton | losboton := self model botones. miboton
:= losboton at: 5. ^ self switchButton: miboton! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 09:27'! boton6 | losboton miboton | losboton := self
model botones. miboton := losboton at: 6. ^ self switchButton: miboton! !
!HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton7 | losboton
miboton | losboton := self model botones. miboton := losboton at: 7. ^ self
switchButton: miboton! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
09:27'! boton8 | losboton miboton | losboton := self model botones. miboton
:= losboton at: 8. ^ self switchButton: miboton! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 09:28'! boton9 | losboton miboton | losboton := self
model botones. miboton := losboton at: 9. ^ self switchButton: miboton! !
!HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:04'! brasil ^self cualPais:
'Brasil'. ! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/26/2006 08:39'! britain
^self cualPais: 'Britain'.! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/26/2006
08:36'! california ^self cualPais: 'California'! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/26/2006 08:36'! china ^self cualPais: 'China'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 10:05'! continuar self model continue.
^ self redirectTo: #step! ! !HVTEG methodsFor: 'urls' stamp: 'edc 5/16/2006
15:09'! cualPais: aString
| paises elPais | paises := self model
submorphsSatisfying: [:t7 | t7 isKindOf: PaisMorph]. elPais := paises
detect: [:p | p nombre = aString]. model lastMorph: elPais. elPais clickWeb.
self halt. (model statusFor: ModAuth user ) ifTrue: [^ self redirectTo:
#pause] ifFalse: [^ self redirectTo: #step]! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 5/9/2006 06:33'! default | builder juega | builder := self
builder. juega := model addClient: ModAuth user. juega ifTrue: [builder :=
self builder. builder html: '<meta http-equiv="Refresh" content="15" >'.
builder html: '<img src="http://localhost:8000/screen">'. builder hr;
srcLink; end. ^ builder] ifFalse: [^ self redirectTo: #step]! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/25/2006 18:00'! eastocean ^self cualPais:
'EastOcean'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:25'! egipto
^self cualPais: 'Egipto'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 4/12/2006
10:47'! espania ^self cualPais: 'Espania'! ! !HVTEG methodsFor: 'urls' stamp:
'edc 3/24/2006 08:00'! etiopia ^self cualPais: 'EtiopÃa'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/30/2006 11:55'! finAtaque self model
fortificar. ^ self redirectTo: #step! ! !HVTEG methodsFor: 'urls' stamp: 'edc
3/30/2006 11:57'! finataque self model fortificar. ^ self redirectTo: #step! !
!HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:05'! florida ^self cualPais:
'Florida'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/27/2006 09:07'! fortificar
self model fortificar. ^ self redirectTo: #step! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:27'! france ^self cualPais: 'France'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:06'! germany ^self cualPais:
'Germany'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:27'! gobi
^self cualPais: 'Gobi'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
08:06'! groenland ^self cualPais: 'Groenland'! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:27'! india ^self cualPais: 'India'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:06'! island ^self cualPais:
'Island'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:28'! italia
^self cualPais: 'Italia'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
08:28'! japon ^self cualPais: 'Japón'! ! !HVTEG methodsFor: 'urls' stamp:
'edc 3/24/2006 08:28'! kamchatka ^self cualPais: 'Kamchatka'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:29'! labrador ^self cualPais:
'Labrador'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:29'!
madagascar ^self cualPais: 'Madagascar'! ! !HVTEG methodsFor: 'urls' stamp:
'edc 3/24/2006 08:29'! malasia ^self cualPais: 'Malasia'! ! !HVTEG methodsFor:
'urls' stamp: 'edc 3/24/2006 08:06'! mexico ^self cualPais: 'Mexico'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:30'! mongolia ^self cualPais:
'Mongolia'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/30/2006 11:36'! newyork
^self cualPais: 'NewYork'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/26/2006
08:20'! newzeland ^self cualPais: 'NewZeland'! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:07'! oregon ^self cualPais: 'Oregon'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 5/13/2006 06:56'! pause | status | status :=
TEGMain current statusFor: ModAuth user . status ifTrue:[^self
step ] ifFalse: [ ^ '<HTML> <HEAD> <TITLE>Squeak TEG</TITLE>
</HEAD> <meta http-equiv="Refresh" content="10" > <BODY>
<br> <img
src="http://localhost:8000/screen"> <br> <h3>You are in pause now </h3>
</BODY> </HTML>']! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:07'!
peru ^self cualPais: 'Peru'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/23/2006
11:39'! refresh | builder |
builder := self builder. model grabaFoto.
builder html: '<img src= "http://localhost:81/STEG/TEG.jpg" width="750"
height="490" border="0" '.
^ builder.! ! !HVTEG methodsFor: 'urls' stamp:
'edc 3/24/2006 08:30'! rusia ^self cualPais: 'Rusia'! ! !HVTEG methodsFor:
'urls' stamp: 'edc 3/24/2006 08:31'! sahara ^self cualPais: 'Sahara'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:31'! scandinav ^self cualPais:
'Scandinav'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 5/8/2006 10:42'! screen ^
TEGMain current grabaFoto! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
08:31'! siberia ^self cualPais: 'Siberia'! ! !HVTEG methodsFor: 'urls' stamp:
'edc 5/9/2006 07:43'! step | builder button | builder := self builder.
builder postForm. builder html: '<img
src="http://localhost:8000/screen"usemap="#Map"> '. builder html: '<map
name="Map"> <area shape="poly"
coords="132,420,74,454,73,462,85,471,62,469,57,460,61,451,89,379,103,387,111,385\
,131,401" href="argentina"> <area shape="rect" coords= "102,454,147 ,468 "
href="ataque "> <area shape="rect" coords= "225,454,292 ,468 " href="finataque
"> <area shape="rect" coords= "367,454,431 ,468 " href="continuar "> <area
shape="rect" coords= "508,454,568 ,468 " href="fortificar "> <area shape="rect"
coords= "643,454,684 , 468" href="debug "> <area shape="rect" coords=
"200,420,240 , 440" href="boton1 "> <area shape="rect" coords= "245,420,285 ,
440" href="boton2 "> <area shape="rect" coords= "290,420,330 , 440" href="boton3
"> <area shape="rect" coords= "335,420,375 , 440" href="boton4 "> <area
shape="rect" coords= "380,420,420 , 440" href="boton5 "> <area shape="rect"
coords= "425,465,465 , 440" href="boton6 "> <area shape="rect" coords=
"470,420,510 , 440" href="boton7 "> <area shape="rect" coords= "515,420,555 ,
440" href="boton8 "> <area shape="rect" coords= "560,420,600 , 440" href="boton9
">
<area shape="poly" coords="69 ,316 ,97 ,324 ,99 ,332 ,100 ,340 ,111 ,351
,133 ,374 ,129 ,393 ,115 ,382 ,92 ,378 ,68 ,354 ,69 ,317" href="peru "> <area
shape="poly" coords="62 ,324 ,202 ,341 ,212 ,354 ,179 ,392 ,164 ,390 ,137 ,417
,135 ,396 ,139 ,375 ,115 ,350 ,101 ,333 ,120 ,320" href="brasil "> <area
shape="poly" coords=" 84 ,293 ,103 ,291 ,115 ,300 ,125 ,296 ,158 ,314 ,161 ,321
,124 ,318 ,105 ,325 ,72 ,313 ,80 ,299 ,85 ,292" href="venezuela "> <area
shape="poly" coords=" 50 ,228 ,78 ,226 ,97 ,241 ,97 ,255 ,112 ,260 ,111 ,275
,114 ,295 ,105 ,288 ,79 ,265 ,66 ,263 ,47 ,241 " href="mexico">
<area
shape="poly" coords=" 129 ,192 ,154 ,193 ,175 ,215 ,193 ,208 ,223 ,209 ,174 ,228
,144 ,237 ,149 ,257 ,140 ,256 ,125 ,246 ,100 ,245 " href="florida">
<area
shape="poly" coords=" 48 ,180 ,126 ,192 ,121 ,201 ,113 ,210 ,108 ,219 ,100 ,227
,95 ,237 ,77 ,224 ,50 ,225 ,40 ,215 ,41 ,197 " href="california">
<area
shape="poly" coords=" 58 ,139 ,123 ,143 ,120 ,189 ,49 ,177 ,47 ,173 ,44 ,163 ,53
,158 ,61 ,153 ,61 ,139 ,82 ,138 ,104 ,140 " href="oregon">
<area shape="poly"
coords=" 128 ,141 ,168 ,143 ,178 ,152 ,170 ,168 ,189 ,181 ,183 ,205 ,174 ,210
,158 ,190 ,125 ,187 ,125 ,168 ,125 ,151 " href="newyork">
<area shape="poly"
coords=" 204 ,153 ,213 ,153 ,218 ,164 ,229 ,161 ,235 ,170 ,251 ,173 ,252 ,179
,237 ,186 ,224 ,196 ,215 ,205 ,186 ,201 " href="labrador">
<area shape="poly"
coords=" 10 ,88 ,41 ,77 ,62 ,90 ,63 ,135 ,54 ,139 ,58 ,151 ,45 ,157 ,49 ,147 ,40
,131 ,18 ,136 ,15 ,115 " href="alaska">
<area shape="poly" coords=" 66 ,92
,93 ,92 ,131 ,106 ,161 ,111 ,184 ,99 ,205 ,115 ,187 ,137 ,66 ,136 ,65 ,118 ,64
,99 ,65 ,93 " href="yukon">
<area shape="poly" coords=" 293 ,56 ,314 ,76 ,284
,136 ,314 ,105 ,269 ,147 ,260 ,133 ,250 ,110 ,240 ,92 ,227 ,90 ,236 ,76 ,246 ,54
" href="groenland">
<area shape="poly" coords=" 268 ,159 ,274 ,156 ,279 ,155
,288 ,158 ,292 ,164 ,291 ,169 ,287 ,172 ,281 ,174 ,274 ,174 ,267 ,168 ,263 ,162
" href="island">
<area shape="poly" coords=" 300 ,164 ,314 ,157 ,329 ,157
,336 ,183 ,330 ,207 ,319 ,204 ,308 ,216 ,300 ,217 ,286 ,218 ,280 ,201 ,298 ,185
" href="scandinav">
<area shape="poly" coords=" 333 ,158 ,347 ,160 ,351 ,169
,389 ,147 ,393 ,177 ,389 ,207 ,367 ,225 ,359 ,267 ,315 ,249 ,313 ,232 ,321 ,222
" href="germany">
<area shape="poly" coords=" 291 ,230 ,309 ,230 ,312 ,239
,314 ,246 ,306 ,249 ,299 ,251 ,292 ,257 ,286 ,253 ,279 ,248 ,280 ,242 ,285 ,237
" href="france">
<area shape="poly" coords=" 278 ,235 ,273 ,241 ,266 ,238
,260 ,239 ,259 ,244 ,253 ,239 ,253 ,232 ,259 ,228 ,261 ,219 ,268 ,217 ,275 ,223
" href="britain">
<area shape="poly" coords=" 277 ,248 ,266 ,253 ,267 ,261
,249 ,262 ,245 ,267 ,254 ,281 ,265 ,279 ,272 ,268 ,288 ,268 ,294 ,260 ,285 ,254
" href="espania">
<area shape="poly" coords=" 292 ,268 ,295 ,263 ,300 ,255
,307 ,252 ,313 ,251 ,321 ,255 ,327 ,262 ,323 ,266 ,319 ,270 ,310 ,269 ,304 ,282
" href="italia">
<area shape="poly" coords=" 393 ,146 ,397 ,175 ,394 ,202
,408 ,203 ,428 ,210 ,441 ,222 ,447 ,228 ,453 ,221 ,446 ,154 ,431 ,103 ,415 ,134
" href="rusia">
<area shape="poly" coords=" 367 ,226 ,390 ,210 ,407 ,205 ,426
,212 ,440 ,225 ,443 ,236 ,426 ,249 ,423 ,265 ,403 ,271 ,386 ,268 ,365 ,268 "
href="mongolia">
<area shape="poly" coords=" 319 ,274 ,329 ,260 ,361 ,270
,371 ,282 ,393 ,301 ,368 ,311 ,341 ,293 ,339 ,281 ,334 ,275 ,327 ,275 ,323 ,273
" href="turquia">
<area shape="poly" coords=" 369 ,273 ,386 ,271 ,420 ,270
,439 ,268 ,452 ,271 ,454 ,276 ,452 ,282 ,435 ,308 ,429 ,310 ,420 ,299 ,388 ,289
" href="india">
<area shape="poly" coords=" 503 ,100 ,466 ,100 ,464 ,110 ,439
,113 ,444 ,137 ,448 ,169 ,454 ,222 ,462 ,225 ,471 ,220 ,484 ,190 ,482 ,156 "
href="gobi">
<area shape="poly" coords=" 533 ,96 ,508 ,100 ,496 ,126 ,484
,154 ,499 ,158 ,514 ,155 ,530 ,162 ,531 ,173 ,546 ,173 ,561 ,145 ,570 ,109 "
href="tamir">
<area shape="poly" coords=" 571 ,107 ,581 ,103 ,595 ,107 ,593
,124 ,586 ,152 ,575 ,167 ,572 ,195 ,562 ,199 ,554 ,179 ,549 ,173 ,557 ,160 "
href="kamchatka">
<area shape="poly" coords=" 486 ,158 ,502 ,162 ,514 ,157
,528 ,163 ,529 ,174 ,522 ,187 ,514 ,196 ,516 ,210 ,477 ,217 ,480 ,204 ,489 ,183
" href="siberia">
<area shape="poly" coords=" 435 ,247 ,451 ,228 ,464 ,227
,474 ,228 ,483 ,235 ,499 ,238 ,508 ,242 ,516 ,248 ,510 ,267 ,499 ,276 ,426 ,263
" href="china">
<area shape="poly" coords=" 515 ,212 ,484 ,217 ,478 ,222 ,479
,229 ,488 ,233 ,497 ,235 ,510 ,242 ,517 ,247 ,523 ,250 ,527 ,232 ,518 ,227 "
href="tsamir">
<area shape="poly" coords=" 531 ,177 ,542 ,175 ,549 ,177 ,545
,186 ,535 ,191 ,537 ,215 ,532 ,230 ,521 ,229 ,518 ,213 ,515 ,201 ,523 ,190 "
href="aral">
<area shape="poly" coords=" 555 ,215 ,566 ,214 ,568 ,219 ,563
,226 ,562 ,242 ,554 ,251 ,547 ,267 ,541 ,267 ,542 ,259 ,547 ,247 ,554 ,234 "
href="japon">
<area shape="poly" coords=" 455 ,271 ,473 ,271 ,485 ,277 ,495
,280 ,500 ,291 ,494 ,299 ,483 ,297 ,499 ,316 ,494 ,321 ,470 ,305 ,458 ,291 "
href="malasia">
<area shape="poly" coords=" 482 ,322 ,491 ,322 ,498 ,320 ,505
,318 ,511 ,315 ,517 ,325 ,526 ,329 ,528 ,338 ,518 ,341 ,510 ,345 ,490 ,347 "
href="sumatra">
<area shape="poly" coords=" 546 ,327 ,557 ,328 ,571 ,328 ,584
,333 ,586 ,344 ,572 ,344 ,562 ,341 ,555 ,340 ,545 ,339 ,538 ,335 ,541 ,328 "
href="newzeland">
<area shape="poly" coords=" 544 ,352 ,551 ,347 ,563 ,352
,572 ,352 ,589 ,360 ,589 ,376 ,586 ,390 ,571 ,395 ,541 ,391 ,537 ,379 ,541 ,373
" href="eastocean">
<area shape="poly" coords=" 515 ,362 ,528 ,351 ,540 ,354
,539 ,371 ,533 ,378 ,537 ,392 ,532 ,400 ,517 ,404 ,499 ,391 ,494 ,380 ,509 ,372
" href="westocean">
<area shape="poly" coords=" 239 ,286 ,287 ,285 ,280 ,295
,278 ,303 ,306 ,319 ,313 ,338 ,317 ,360 ,283 ,358 ,248 ,344 ,221 ,331 ,216 ,310
" href="sahara">
<area shape="poly" coords=" 291 ,290 ,332 ,290 ,349 ,303
,322 ,307 ,314 ,313 ,310 ,318 ,296 ,312 ,284 ,304 ,281 ,298 ,285 ,293 ,288 ,291
" href="egipto">
<area shape="poly" coords=" 325 ,360 ,315 ,337 ,312 ,326
,315 ,316 ,324 ,312 ,334 ,307 ,352 ,308 ,360 ,315 ,374 ,318 ,355 ,344 ,350 ,365
" href="etiopia">
<area shape="poly" coords=" 283 ,364 ,325 ,366 ,336 ,373
,351 ,368 ,344 ,384 ,336 ,400 ,320 ,410 ,303 ,409 ,292 ,393 ,293 ,381 ,281 ,375
" href="sudafrica">
<area shape="poly" coords=" 360 ,375 ,367 ,374 ,371 ,372
,379 ,378 ,371 ,386 ,368 ,395 ,370 ,406 ,363 ,411 ,352 ,410 ,350 ,401 ,355 ,385
" href="madagascar"> </map>'. self model puedeAtacar ifTrue: [button :=
builder br; submit: model lastMorph] ifFalse: [builder h3: model lastMorph
printString]. builder endForm. "Was the button pressed?" button ifNotNil:
[button ifPressed: [ model ataqueWeb. ^self step]]. builder hr;
srcLink; end. ^ builder! ! !HVTEG methodsFor: 'urls' stamp: 'edc 5/12/2006
08:57'! stop self class stop! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006
08:03'! sudafrica ^self cualPais: 'Sudafrica'! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:32'! sumatra ^self cualPais: 'Sumatra'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 09:26'! switchButton: aButton
aButton setSwitchState: aButton estado not. model lastMorph: aButton. ^ self
redirectTo: #step! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/24/2006 08:32'!
tamir ^self cualPais: 'Tamir'! ! !HVTEG methodsFor: 'urls' stamp: 'edc
3/24/2006 08:32'! tsamir ^self cualPais: 'Tsamir'! ! !HVTEG methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:32'! turquia ^self cualPais: 'Turquia'! ! !HVTEG
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:07'! venezuela ^self cualPais:
'Venezuela'! ! !HVTEG methodsFor: 'urls' stamp: 'edc 3/25/2006 18:00'!
westocean ^self cualPais: 'WestOcean'! ! !HVTEG methodsFor: 'urls' stamp: 'edc
3/24/2006 08:08'! yukon ^self cualPais: 'Yukon'! ! "-- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- "! HVTEG class instanceVariableNames: 'maxClient
current'! !HVTEG class methodsFor: 'accessing' stamp: 'edc 3/20/2006 08:13'!
current ^ current! ! !HVTEG class methodsFor: 'accessing' stamp: 'edc 3/20/2006
08:13'! current: aString current:= aString! ! !HVTEG class methodsFor:
'accessing' stamp: 'edc 3/4/2006 10:50'! maxClient ^maxClient! !
!HVTEG class
methodsFor: 'start/stop' stamp: 'edc 5/9/2006 07:39'! createModel "This is
called automatically when the web application is started." ^TEGMain reset ! !
!HVTEG class methodsFor: 'start/stop' stamp: 'edc 3/3/2006 07:04'! rootView
"Return custom class for the root view."
^TEGServerRoot! !
Morph subclass: #InformaCartas instanceVariableNames:
'' classVariableNames: '' poolDictionaries: '' category: 'Morphic-TEG'!
!InformaCartas methodsFor: 'initialization' stamp: 'edc 3/24/2006 10:20'!
initialize: t1
| t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 | super initialize. self
bounds: (Rectangle left: 710 right: 748 top: 220 bottom: 460).
self color: Color white. self borderColor: Color black. self borderWidth: 2.
t2 := 6. t3 := (216 / t2) asInteger. t4 := 224. t5 := 224 + t3. t6 := 237.
t7 := 247. t3 := t3 + 3. 1 to: t2 do: [:t12 |
t8 := Morph new. t8
bounds: (Rectangle left: 712 right: 748 top: t4 bottom:
t5). t8 color: (t1 at: t12) miColor. t8 borderColor: Color black. t8
borderWidth: 2. self addMorph: t8. (t1 at: t12) vive ifTrue: [t9 :=
Morph new. t9 bounds: (Rectangle left: 720 right: 738
top: t6 bottom: t7). t9 color: Color white. t9 borderColor:
Color black. t9 borderWidth: 2. self addMorph: t9. t10 :=
StringMorph contents: (t1 at: t12) misCartas size asString. t10 center: t9
center. self addMorph: t10] ifFalse: [t11 := DrawPicture new
initializeWith: #Muerte valor: 0 pos: t8 topLeft. self
addMorph: t11]. t4 := t4 + t3. t5 := t5 + t3. t6 := t6 + t3. t7 :=
t7 + t3]. ! ! !InformaCartas methodsFor: 'initialization' stamp: 'edc 3/24/2006
10:22'! initialize: t1 topRight: aPoint | t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 |
super initialize. self bounds: (Rectangle left: 710 right: 748
top: 220 bottom: 460). self color: Color white. self borderColor: Color
black. self borderWidth: 2. t2 := 6. t3 := (216 / t2) asInteger. t4 := 224.
t5 := 224 + t3. t6 := 237. t7 := 247. t3 := t3 + 3. 1 to: t2 do: [:t12 |
t8 := Morph new. t8 bounds: (Rectangle left: 712 right: 748
top: t4 bottom: t5). t8 color: (t1 at: t12) miColor. t8 borderColor:
Color black. t8 borderWidth: 2. self addMorph: t8. (t1 at: t12) vive
ifTrue: [t9 := Morph new. t9 bounds: (Rectangle left: 720
right: 738 top: t6 bottom: t7). t9 color: Color white.
t9 borderColor: Color black. t9 borderWidth: 2. self addMorph: t9.
t10 := StringMorph contents: (t1 at: t12) misCartas size asString. t10
center: t9 center. self addMorph: t10] ifFalse: [t11 := DrawPicture new
initializeWith: #Muerte valor: 0 pos: t8 topLeft. self
addMorph: t11]. t4 := t4 + t3. t5 := t5 + t3. t6 := t6 + t3. t7 :=
t7 + t3]. self topRight: aPoint! !
Object subclass: #Jugador
instanceVariableNames: 'vive esHumano misPaises misCartas miColor nombre status'
classVariableNames: '' poolDictionaries: '' category: 'Morphic-TEG'! !Jugador
methodsFor: 'accesing'! esHumano ^ esHumano! ! !Jugador methodsFor:
'accesing'! esHumano: t1
esHumano _ t1! ! !Jugador methodsFor: 'accesing'!
initialize vive _ true. esHumano _ false. misPaises _ OrderedCollection new.
misCartas _ OrderedCollection new! ! !Jugador methodsFor: 'accesing'! miColor
^ miColor! ! !Jugador methodsFor: 'accesing'! miColor: t1
miColor _ t1! !
!Jugador methodsFor: 'accesing'! misCartas ^ misCartas! ! !Jugador methodsFor:
'accesing'! misCartas: t1
misCartas add: t1! ! !Jugador methodsFor:
'accesing'! misPaises ^ misPaises! ! !Jugador methodsFor: 'accesing'!
misPaises: t1
misPaises add: t1! ! !Jugador methodsFor: 'accesing' stamp:
'edc 3/4/2006 11:04'! nombre ^ nombre! ! !Jugador methodsFor: 'accesing'
stamp: 'edc 3/4/2006 11:04'! nombre: t1
nombre _ t1! ! !Jugador methodsFor:
'accesing' stamp: 'edc 3/19/2006 09:52'! status ^ status! ! !Jugador
methodsFor: 'accesing' stamp: 'edc 3/19/2006 09:52'! status: t1
status _ t1! !
!Jugador methodsFor: 'accesing'! vive ^ vive! ! !Jugador methodsFor:
'accesing'! vive: t1
vive _ t1! !
!Jugador methodsFor: 'as yet
unclassified'! sortCartas | t1 | t1 _ SortedCollection new. t1 sortBlock:
[:t2 :t3 | t2 \\\ 3 < (t3 \\\ 3)]. misCartas do: [:t4 | t1 add: t4].
misCartas _ t1 asOrderedCollection! !
PolygonMorph subclass: #PaisMorph
instanceVariableNames: 'nombre ejEnPais deQuienSoy numero misLimites'
classVariableNames: '' poolDictionaries: '' category: 'Morphic-TEG'!
!PaisMorph methodsFor: 'initialization' stamp: 'edc 5/7/2006 11:21'! initialize
super initialize. misLimites _ SortedCollection new! ! !PaisMorph methodsFor:
'initialization'! nombre: t1 limites: t2
| t3 t4 t5 | nombre _ t1. ejEnPais
_ 0. self vertices: t2 asArray color: Color white borderWidth: 2
borderColor: Color black. t4 _ self center. t5 _ Morph new. t5 bounds:
(Rectangle left: t4 x right: t4 x + 15 top: t4 y bottom: t4 y +
10). t5 color: Color white. self addMorph: t5. t3 _ TextMorph new. t3
autoFit: true. t3 string: ejEnPais asString fontName: #ComicBold size: 18
wrap: false. t3 contents: ejEnPais asString. t3 bounds: t5. t3 centered.
self addMorph: t3. t3 lock! !
!PaisMorph methodsFor: 'event handling' stamp:
'edc 5/20/2006 10:06'! clickWeb | soldados |
owner estado = 2 & (owner
playerTurn = deQuienSoy) not ifTrue: [owner puedeAtacar: ( misLimites
includes: owner paisAtacante numero). owner lastMorph: owner paisAtacante
nombre , ' Ataca ' , self nombre. ^ self]. owner playerTurn = deQuienSoy
ifFalse: [owner lastMorph: 'This country is of ' , (owner losJugadores at:
deQuienSoy) nombre. ^ self]. owner estado = #fortificar ifTrue:[owner
paisOrigen: self. ^ self ]. owner estado = 2 ifTrue: [self borderWidth:
4; borderColor: Color white. owner lastMorph: self nombre , ' ready to
Atack'. owner paisAtacante = self ifFalse: [ owner paisAtacante: self.
^ self]]. soldados := owner submorphsSatisfying: [:t7 | t7 isKindOf:
DrawPicture]. soldados do: [:s | s estado ifTrue: [ejEnPais := ejEnPais +
s valor. owner pone: owner pone - s valor. owner botones removeKey:
((owner botones) keyAtValue: s ifAbsent:[]). s delete]]. self mostrar.
owner pone = 0 ifTrue: [owner ronda <= 5 ifTrue: [owner continue]
ifFalse: [owner estado: 2]]! ! !PaisMorph methodsFor: 'event handling'!
firstClickTimedOut: t1
| t2 t3 | t2 _ owner rootForGrabOf: self. t2 ifNil:
[t3 _ self copy. self board owner owner addMorphFront: t3. self world
displayWorld. (Delay forMilliseconds: 750) wait. t3 delete] ifNotNil:
[t1 hand grabMorph: t2]! ! !PaisMorph methodsFor: 'event handling'!
handlesMouseDown: t1
^ true! ! !PaisMorph methodsFor: 'event handling'!
mouseDown: t1
t1 hand waitForClicksOrDrag: self event: t1! ! !PaisMorph
methodsFor: 'event handling'! mouseEnter: t1
| t2 | t2 _ 'Soy ' , nombre
asString , ' y pertenezco a ' , deQuienSoy asString. self showBalloon: t2 hand:
t1 hand! !
!PaisMorph methodsFor: 'access'! add: t1
ejEnPais _ ejEnPais +
t1. self mostrar! ! !PaisMorph methodsFor: 'access' stamp: 'edc 5/7/2006
11:22'! click: t1
| t2 t3 | t2 := 'Soy ' , nombre asString , ' numero ' ,
numero asString , 'y pertenezco a ' , deQuienSoy asString. self showBalloon: t2
hand: t1 hand. t3 := 0.
(owner permitido: numero) ifFalse: [^ false].
owner submorphs do: [:t4 | t4 class == DrawPicture ifTrue: [t3 := t3 + 1.
owner pone: owner pone - 1. t4 estado ifTrue: [ejEnPais := ejEnPais +
t4 valor. t3 := t3 - 1. t4 delete]]]. self mostrar. t3 = 1
ifTrue: [owner ronda <= 5 ifTrue: [owner continue] ifFalse: [owner
estado: 2]]! ! !PaisMorph methodsFor: 'access'! deQuienSoy ^ deQuienSoy! !
!PaisMorph methodsFor: 'access'! deQuienSoy: t1
deQuienSoy _ t1! ! !PaisMorph
methodsFor: 'access'! doubleClick: t1
1 to: 42 do: [:t2 | (owner submorphs
at: t2) color: Color white]. (owner submorphs at: numero) color: Color
green. misLimites do: [:t3 | (owner submorphs at: t3) color: Color red].
self borderWidth: 4; borderColor: Color red. ^ self numero! ! !PaisMorph
methodsFor: 'access'! ejercitos ^ ejEnPais! ! !PaisMorph methodsFor: 'access'!
ejercitos: t1
ejEnPais _ t1. self mostrar! ! !PaisMorph methodsFor:
'access'! misLimites ^ misLimites! ! !PaisMorph methodsFor: 'access'!
misLimites: t1
misLimites _ t1! ! !PaisMorph methodsFor: 'access' stamp: 'edc
3/25/2006 07:46'! mostrar | t4 t5 t3 | self submorphsDo: [:t1 | t1 delete].
t4 := self center. t5 := Morph new. t5 bounds: (Rectangle left: t4 x
right: t4 x + 15 top: t4 y bottom: t4 y + 10). t5 color: Color white.
self addMorph: t5. t3 := TextMorph new. t3 autoFit: true. t3 string:
ejEnPais asString fontName: #ComicBold size: 18 wrap: false. t3 contents:
ejEnPais asString. t3 bounds: t5. t3 centered. self addMorph: t3. t3 lock.
self submorphsDo:[:t1 | t1 center: self center].! ! !PaisMorph methodsFor:
'access'! noMostrar submorphs do: [:t1 | t1 delete]! ! !PaisMorph
methodsFor: 'access'! nombre ^ nombre! ! !PaisMorph methodsFor: 'access'!
numero ^ numero! ! !PaisMorph methodsFor: 'access'! numero: t1
numero _ t1!
! !PaisMorph methodsFor: 'access'! otroLimites: t1
misLimites _ misLimites
add: t1! ! !PaisMorph methodsFor: 'access'! redrawInColor: t1
self color: t1.
submorphs first contents: ejEnPais asString. submorphs do: [:t2 | t2 center:
self center]! !
!PaisMorph methodsFor: 'as yet unclassified' stamp: 'edc
3/24/2006 16:02'! normal self borderWidth: 2; borderColor: Color black! !
!PaisMorph methodsFor: 'as yet unclassified' stamp: 'edc 10/26/2004 08:18'!
reset self color: Color white. self deQuienSoy: 0. self ejercitos: 0.! !
Object subclass: #TEGConsole2 instanceVariableNames: '' classVariableNames: ''
poolDictionaries: '' category: 'Morphic-TEG'! "-- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- "! TEGConsole2 class instanceVariableNames: ''!
!TEGConsole2 class methodsFor: 'as yet unclassified' stamp: 'edc 5/5/2006
19:07'! default: aString | r m | m := StringMorph new contents: aString;
font: Preferences windowTitleFont emphasis: (Preferences windowTitleFont
isTTCFont ifTrue: [0] ifFalse: [1]). r := RectangleMorph new extent: m
fullBounds extent. r addMorph: m. ^r! !
BorderedMorph subclass: #TEGMain
instanceVariableNames: 'cartasOrden losJugadores puedeAtacar jugadoresVivos
cartel pone cambiosTotales playerTurn ronda limites done lim estado numCarta
mazo botones lastMorph maxClient paisAtacante paisOrigen paisDestino'
classVariableNames: '' poolDictionaries: '' category: 'Morphic-TEG'! !TEGMain
methodsFor: 'accessing' stamp: 'edc 3/14/2006 10:17'! botones ^botones! !
!TEGMain methodsFor: 'accessing' stamp: 'edc 3/27/2006 08:53'! botones: anObject
"Set the value of botones"
botones := anObject! ! !TEGMain methodsFor:
'accessing'! cambiosTotales ^ cambiosTotales! ! !TEGMain methodsFor:
'accessing'! cambiosTotales: t1
cambiosTotales _ t1! ! !TEGMain methodsFor:
'accessing'! cartasOrden ^ cartasOrden! ! !TEGMain methodsFor: 'accessing'!
cartasOrden: t1
cartasOrden _ t1! ! !TEGMain methodsFor: 'accessing'! cartel
^ cartel! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 4/12/2006 10:08'!
cartel: anObject cartel := anObject. "t2 beAllFont: (StrikeFont familyName:
#ComicBold size: 18)." anObject color: Color red.
anObject extent: self
width - 30 @ 40. anObject center: self center. anObject top: self top + 10.
self addMorphBack: anObject! ! !TEGMain methodsFor: 'accessing'! done ^ done!
! !TEGMain methodsFor: 'accessing'! done: t1
done _ t1! ! !TEGMain
methodsFor: 'accessing'! estado ^ estado! ! !TEGMain methodsFor: 'accessing'
stamp: 'EDC 6/29/2002 10:30'! estado: aInteger
estado _ aInteger! ! !TEGMain
methodsFor: 'accessing'! jugadoresVivos ^ jugadoresVivos! ! !TEGMain
methodsFor: 'accessing'! jugadoresVivos: t1
jugadoresVivos _ t1! ! !TEGMain
methodsFor: 'accessing' stamp: 'edc 3/24/2006 08:38'! lastMorph ^lastMorph ! !
!TEGMain methodsFor: 'accessing' stamp: 'edc 3/24/2006 08:38'! lastMorph: aMorph
lastMorph:= aMorph! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 3/27/2006
08:53'! lim "Answer the value of lim"
^ lim! ! !TEGMain methodsFor:
'accessing' stamp: 'edc 3/27/2006 08:53'! lim: anObject "Set the value of lim"
lim := anObject! ! !TEGMain methodsFor: 'accessing'! limites ^ limites! !
!TEGMain methodsFor: 'accessing'! limites: t1
limites _ t1! ! !TEGMain
methodsFor: 'accessing'! losJugadores ^ losJugadores! ! !TEGMain methodsFor:
'accessing'! losJugadores: t1
losJugadores _ t1! ! !TEGMain methodsFor:
'accessing' stamp: 'edc 3/24/2006 08:39'! maxClient ^ maxClient! ! !TEGMain
methodsFor: 'accessing' stamp: 'edc 3/27/2006 08:53'! maxClient: anObject "Set
the value of maxClient"
maxClient := anObject! ! !TEGMain methodsFor:
'accessing'! mazo ^ mazo! ! !TEGMain methodsFor: 'accessing'! mazo: t1
mazo
_ t1! ! !TEGMain methodsFor: 'accessing'! numCarta ^ numCarta! ! !TEGMain
methodsFor: 'accessing'! numCarta: t1
numCarta _ t1! ! !TEGMain methodsFor:
'accessing' stamp: 'edc 3/24/2006 11:06'! paisAtacante ^ paisAtacante! !
!TEGMain methodsFor: 'accessing' stamp: 'edc 3/24/2006 11:07'! paisAtacante: t1
paisAtacante := t1! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 3/27/2006
08:53'! paisDestino "Answer the value of paisDestino"
^ paisDestino! !
!TEGMain methodsFor: 'accessing' stamp: 'edc 3/27/2006 09:05'! paisDestino:
anObject "Set the value of paisDestino"
paisDestino := anObject. self
fortificarWeb! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 3/27/2006 08:53'!
paisOrigen "Answer the value of paisOrigen"
^ paisOrigen! ! !TEGMain
methodsFor: 'accessing' stamp: 'edc 3/27/2006 09:34'! paisOrigen: anObject "Set
the value of paisOrigen" paisOrigen ifNotNil: [self paisDestino: anObject ]
ifNil:[paisOrigen := anObject. self lastMorph: ' Troops are living ', anObject
nombre]. ! ! !TEGMain methodsFor: 'accessing'! paises: t1
| t2 t3 | 1 to:
42 do: [:t4 |
(submorphs at: t4) ejercitos: ((t1 at: t4) at: 1).
(submorphs at: t4) deQuienSoy: ((t1 at: t4) at: 2). t2 _ (submorphs
at: t4) deQuienSoy. t3 _ (losJugadores at: t2) miColor. (submorphs at: t4)
redrawInColor: t3]! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 3/24/2006
10:56'! playerTurn
^ playerTurn! ! !TEGMain methodsFor: 'accessing'!
playerTurn: t1
playerTurn _ t1! ! !TEGMain methodsFor: 'accessing'! pone ^
pone! ! !TEGMain methodsFor: 'accessing'! pone: t1
pone _ t1! ! !TEGMain
methodsFor: 'accessing' stamp: 'edc 3/25/2006 07:14'! puedeAtacar ^
puedeAtacar! ! !TEGMain methodsFor: 'accessing' stamp: 'edc 3/25/2006 07:14'!
puedeAtacar: t1
puedeAtacar := t1! ! !TEGMain methodsFor: 'accessing'! ronda
^ ronda! ! !TEGMain methodsFor: 'accessing'! ronda: t1
ronda _ t1! !
!TEGMain methodsFor: 'as yet unclassified' stamp: 'EDC 6/27/2002 15:51'!
hacerListaPaises | misLimites listaLimpia | misLimites _ Set new. "Deseo la
lista total de los paises limitrofes a mis paises" (losJugadores at:
playerTurn) misPaises do: [:pais | limites do: [:each | (each includes:
pais) ifTrue: [misLimites add: each]]]. "Debo eliminar de la lista las
fronteras de paises que ambos me
pertenezcan" listaLimpia _ misLimites copy.
misLimites do: [:frontera | (((losJugadores at: playerTurn) misPaises
includes: (frontera at: 1)) and: [(losJugadores at: playerTurn) misPaises
includes: (frontera at: 2)]) ifTrue: [listaLimpia remove: frontera]].
^listaLimpia! ! !TEGMain methodsFor: 'as yet unclassified' stamp: 'EDC
6/22/2002 11:01'! optimizarCambio | index tipo otroIndex temp | (losJugadores
at: playerTurn) misCartas do: [:pais | ((losJugadores at: playerTurn)
misPaises includes: pais) ifTrue: [index _ (losJugadores at: playerTurn)
misCartas indexOf: pais. tipo _ pais \\\ 3]]. otroIndex _ 0.
(losJugadores at: playerTurn) misCartas do: [:otraCarta |
otroIndex _
otroIndex + 1. otraCarta \\\ 3 = tipo ifTrue: [temp _ (losJugadores at:
playerTurn) misCartas at: index. (losJugadores at: playerTurn) misCartas
at: index put: ((losJugadores at: playerTurn) misCartas at: otroIndex).
(losJugadores at: playerTurn) misCartas at: otroIndex put: temp. ^ true]]!
!
!TEGMain methodsFor: 'debug and other' stamp: 'edc 10/19/2004 16:49'! debug
^self inspect. ! ! !TEGMain methodsFor: 'debug and other' stamp: 'edc
10/19/2004 16:49'! split self eligeEjercitos: pone jugador: playerTurn! !
!TEGMain methodsFor: 'event handling' stamp: 'EDC 5/17/2002 05:34'!
handlesMouseDown: evt
"Prevent stray clicks from picking up the whole game in
MVC." ^ Smalltalk isMorphic not or: [evt yellowButtonPressed]! ! !TEGMain
methodsFor: 'event handling'! mouseDown: t1
| t2 | t1 yellowButtonPressed
ifFalse: [^ self]. t2 _ MenuMorph new defaultTarget: self. self
addMenuItemsTo: t2 hand: t1 hand. t2 popUpEvent: t1 in: self world! !
!TEGMain methodsFor: 'fileIn/out' stamp: 'EDC 6/23/2002 06:46'! grabaEstado |
outputStream | outputStream _ ReferenceStream fileNamed: 'estado.teg'.
outputStream nextPut: losJugadores. outputStream nextPut: cartasOrden.
outputStream nextPut: jugadoresVivos. outputStream nextPut: playerTurn.
outputStream nextPut: ronda. outputStream nextPut: numCarta. outputStream
nextPut: cambiosTotales. 1 to: 42 do: [:pais |
outputStream nextPut:
(submorphs at: pais) ejercitos. outputStream nextPut: (submorphs at: pais)
deQuienSoy]. outputStream close! ! !TEGMain methodsFor: 'fileIn/out' stamp:
'edc 5/9/2006 06:34'! grabaFoto
^(Form fromDisplay: self bounds) ! !
!TEGMain methodsFor: 'fileIn/out'! leerEstado | t1 | t1 _ ReferenceStream
fileNamed: 'estado.teg'. losJugadores _ t1 next. cartasOrden _ t1 next.
jugadoresVivos _ t1 next. playerTurn _ t1 next. ronda _ t1 next. numCarta _
t1 next. cambiosTotales _ t1 next. 1 to: 42 do: [:t2 |
(submorphs at:
t2) ejercitos: t1 next. (submorphs at: t2) deQuienSoy: t1 next]. t1
close. self miColor! !
!TEGMain methodsFor: 'game sequence' stamp: 'edc
10/19/2004 17:26'! armaBatallones | mitadChica s50 s20 s10 s5 s1 batallones |
batallones _ Array new: 5. mitadChica _ pone. s50 _ 0. s20 _ 0. s10 _ 0. s5
_ 0. s1 _ 0. s50 _ (mitadChica / 50) asInteger. mitadChica _ mitadChica \\\
50. s20 _ (mitadChica / 20) asInteger. mitadChica _ mitadChica \\\ 20. s10 _
(mitadChica / 10) asInteger. mitadChica _ mitadChica \\\ 10. mitadChica = 5
ifTrue: [s1 _ 5] ifFalse: [s5 _ (mitadChica / 5) asInteger. s1 _ mitadChica
\\\ 5]. pone <= 9 ifFalse: [[s50 + s20 + s10 + s5 + s1 <= 5] whileTrue:
[s10 > 0 ifTrue: [s10 _ s10 - 1. s5 _ s5 + 2] ifFalse: [s20 >
0 ifTrue: [s20 _ s20 - 1. s10 _ s10 + 2] ifFalse: [s50
> 0 ifTrue: [s50 _ s50 - 1. s20 _ s20 + 2. s10 _
s10 + 5] ifFalse: [s5 > 0 ifTrue: [s5 _ s5 - 1.
s1 _ s1 + 5]]]]]]. batallones at: 1 put: s1. batallones at: 2 put: s5.
batallones at: 3 put: s10. batallones at: 4 put: s20. batallones at: 5 put:
s50. ^ batallones! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc
3/26/2006 09:04'! atacaMaquina | maxValue maxElement val reagrupa pasan
paisAcacado paisAcacante atacarA quedan listaLimpia paises | paises := self
submorphsSatisfying: [:t7 | t7 isKindOf: PaisMorph]. listaLimpia := self
hacerListaPaises: true. listaLimpia do: [:frontera |
((losJugadores at:
playerTurn) misPaises includes: (frontera at: 1)) ifTrue: [paisAcacante
:= paises detect: [:p | p numero = (frontera at: 1)].
paisAcacado := paises detect: [:p | p numero = (frontera at:
2)]] ifFalse: [paisAcacante := paises detect: [:p | p numero
= (frontera at: 2)]. paisAcacado := paises detect: [:p | p numero
= (frontera at: 1)]]. maxValue == nil ifTrue: ["first element"
maxValue _ paisAcacante ejercitos - paisAcacado ejercitos. maxElement :=
paisAcacante numero] ifFalse: [ val := paisAcacante ejercitos -
paisAcacado ejercitos. val > maxValue ifTrue: [maxElement :=
paisAcacante numero. atacarA := paisAcacado numero. maxValue :=
val]] ]. atacarA ifNil: [^ false]. paisAcacado := paises detect:
[:p | p numero = atacarA]. paisAcacante := paises detect: [:p
| p numero = maxElement]. reagrupa := self suerte: paisAcacante
contra: paisAcacado. reagrupa ifTrue: [pone > 2 ifTrue: [pasan := (pone -
2 / 2) asInteger. quedan := pone - pasan. paisAcacante add: quedan.
paisAcacado add: pasan. paisAcacado deQuienSoy: playerTurn. ^ true]
ifFalse: [^ false]] ifFalse: [^ false]! ! !TEGMain methodsFor: 'game
sequence' stamp: 'edc 3/27/2006 08:22'! ataque estado := 2. self lastMorph:
'Ready to attack !!!!' ! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc
3/27/2006 07:57'! ataqueWeb | t5 paisAtacado paises aString |
self
puedeAtacar: false. paises := self submorphsSatisfying: [:t7 | t7 isKindOf:
PaisMorph]. aString := (lastMorph findTokens: ' ') last. paisAtacado := paises
detect: [:p | p nombre = aString]. t5 := self guerraContra: paisAtacado. self
grabaFoto. t5 ifTrue: [self eligeEjercitos: pone jugador: playerTurn.
estado := 3. self lastMorph: 'You win, select more attack , or other
option'. ^true] ifFalse: [self lastMorph: 'You loose '. ^false]
! !
!TEGMain methodsFor: 'game sequence' stamp: 'edc 4/12/2006 10:36'! begin pone:=
5. self eligeEjercitos: 5 jugador: 1. ( cartel submorphs at: 1) color:
(losJugadores at: 1) miColor. ( cartel submorphs at: 1) contents: 'Ronda '
, 1 asString , ' Turno del jugador ' , (losJugadores at: 1) nombre. done:=
true. ! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc 5/17/2006
07:32'! continue done := true. ! ! !TEGMain methodsFor: 'game sequence'!
continue: t1
t1 delete. estado _ 4! ! !TEGMain methodsFor: 'game sequence'
stamp: 'edc 10/19/2004 16:08'! dibuCartas: n hayCambio: aBoolean
| cardDialog
laCarta loHizo rpos oK cartaNumero cancel | cardDialog _ DrawPicture new
initializeWith: #CardsDLOG. oK _ DrawPicture new initializeWith: #Ok
valor: 1 pos: 470 @ 327. oK target: self. oK actionSelector:
#cambiaCartas:. oK arguments: (Array with: cardDialog). cancel _ DrawPicture
new initializeWith: #Cancel valor: 1 pos: 470 @ 292 . cancel
target: self. cancel actionSelector: #continue:. cancel arguments: (Array
with: cardDialog).
cardDialog position: 90 @ 90. cardDialog openInWorld. 1
to: n do: [:t10 |
t10 caseOf: { [1] -> [rpos _ 110 @ 110]. [2] ->
[rpos _ 286 @ 110]. [3] -> [rpos _ 462 @ 110]. [4] -> [rpos _ 198 @
254]. [5] -> [rpos _ 374 @ 254]. [6] -> [rpos _ 110 @ 254]}
otherwise: [rpos _ 20 @ 20]. cartaNumero _ (losJugadores at: playerTurn)
misCartas at: t10. cartaNumero > 42 ifTrue: [laCarta _ DrawCard new
dibujaUnaCarta: cartaNumero] ifFalse: [laCarta _ mazo at: cartaNumero.
laCarta submorphs last noMostrar. laCarta submorphs last color: (submorphs
at: cartaNumero) color]. t10 <= 3 ifTrue: [aBoolean ifTrue:
[laCarta submorphs first estado: true]]. laCarta position: rpos.
cardDialog addMorphBack: laCarta]. cardDialog addMorphBack: oK. cardDialog
addMorphBack: cancel. cardDialog submorphsDo: [:m| m comeToFront]. self world
displayWorld. (losJugadores at: playerTurn) esHumano ifTrue: [aBoolean
ifTrue: [[estado = 4] whileFalse: [World doOneCycle]]. estado _ 1]
ifFalse: [3 timesRepeat: [(Delay forSeconds: 1) wait. "SampledSound
playSoundNamed: 'chirp'." aBoolean ifTrue: [self cambiaCartas:
cardDialog]. loHizo _ true. (Delay forSeconds: 3) wait.
cardDialog delete. ^ loHizo]]! ! !TEGMain methodsFor: 'game sequence'
stamp: 'edc 3/24/2006 16:11'! dibujaUnaCarta2: cardDialog
| | cardDialog
topRight: self topRight + (-20 @ 55) asPoint. cardDialog openInWorld.
"cardDialog center: Display center. p := Player new. p costume: cardDialog. t
:= 1.0. p show. 1 to: 8 do: [:index |
tiempo := 1600 - (100 * index).
(Delay forMilliseconds: tiempo) wait. "FMSound randomWeird1 play." p
setScaleFactor: t. p forward: 100 atRandom. p turn: 360 atRandom. self
world displayWorld. t := t - 0.125]. p erase"! ! !TEGMain methodsFor: 'game
sequence' stamp: 'edc 5/17/2006 07:41'! doCartel ( cartel submorphs at: 1)
color: (losJugadores at: playerTurn) miColor. ( cartel submorphs at: 1)
contents: 'Ronda ' , ronda asString , ' Turno del jugador ' , (losJugadores at:
playerTurn) nombre. ( cartel submorphs at: 1) center: cartel center.! !
!TEGMain methodsFor: 'game sequence' stamp: 'edc 3/26/2006 09:52'!
eligeEjercitos: aInteger jugador: j
| s50 s20 s10 s5 s1 posIcon nEjRec
ejercitos batallones l r boton | l := self left + 155. r := self left + 195.
ejercitos := Array new: 9. nEjRec := Array new: 9. 1 to: 9 do: [:e |
ejercitos at: e put: (Rectangle left: l + (e * 45) right: r
+ (e * 45) top: self bottom - 70 bottom: self bottom - 50).
nEjRec at: e put: 0]. batallones := self armaBatallones. posIcon := 1. s1 :=
batallones at: 1. s5 := batallones at: 2. s10 := batallones at: 3. s20 :=
batallones at: 4. s50 := batallones at: 5. s1 > 0 ifTrue: [1 to: s1
do: [:i |
boton := DrawPicture new. self addMorphBack: boton.
boton initializeWith: #Soldado1 valor: 1 rect: (ejercitos at:
i). posIcon := posIcon + 1. botones at: i put: boton. self
addMorphBack: boton. nEjRec at: i put: 1]]. s5 > 0 ifTrue: [posIcon
to: s5 + posIcon - 1 do: [:i |
boton := DrawPicture new
initializeWith: #Soldado5 valor: 5 rect: (ejercitos at: i).
posIcon := posIcon + 1. botones at: i put: boton. self
addMorphBack: boton. nEjRec at: i put: 5]]. s10 > 0 ifTrue: [posIcon
to: s10 + posIcon - 1 do: [:i |
boton := DrawPicture new
initializeWith: #Soldado10 valor: 10 rect: (ejercitos at: i).
posIcon := posIcon + 1. botones at: i put: boton. self
addMorphBack: boton. nEjRec at: i put: 10]]. s20 > 0 ifTrue: [posIcon
to: s20 + posIcon - 1 do: [:i |
boton := DrawPicture new
initializeWith: #Soldado20 valor: 20 rect: (ejercitos at: i).
posIcon := posIcon + 1. botones at: i put: boton. self
addMorphBack: boton. nEjRec at: i put: 20]]. s50 > 0 ifTrue: [posIcon
to: s50 + posIcon - 1 do: [:i |
boton := DrawPicture new
initializeWith: #Soldado50 valor: 50 rect: (ejercitos at: i).
posIcon := posIcon + 1. botones at: i put: boton. self
addMorphBack: boton. nEjRec at: i put: 50]]. (nEjRec at: 9) = 0
ifTrue: [boton := DrawPicture new. self addMorphBack: boton. boton
initializeWith: #Split valor: 0 rect: (ejercitos at: 9). boton
target: self; actionSelector: #split]! ! !TEGMain methodsFor: 'game
sequence' stamp: 'EDC 5/2/2002 10:56'! endGameFor: aInteger
^ self halt.! !
!TEGMain methodsFor: 'game sequence'! finAtaque done _ true. estado _ 3! !
!TEGMain methodsFor: 'game sequence' stamp: 'edc 3/26/2006 08:18'! finRonda
playerTurn = 6 ifTrue: [ronda := ronda + 1]! ! !TEGMain methodsFor: 'game
sequence' stamp: 'edc 3/27/2006 09:25'! fortificar estado _ #fortificar. self
lastMorph: 'Ready to reagruping !!!!' ! ! !TEGMain methodsFor: 'game
sequence' stamp: 'EDC 6/29/2002 10:19'! fortificarMaquina | misLimites enemigo
misPaises reagrupar n batallon | misLimites _ OrderedCollection new. misPaises
_ (losJugadores at: playerTurn) misPaises asSortedCollection. misPaises do:
[:pais |
enemigo _ false. (submorphs at: pais) misLimites do: [:each
| (misPaises includes: each) ifFalse: [enemigo _ true]]. enemigo
ifFalse: [(submorphs at: pais) ejercitos even ifTrue: [reagrupar _
(submorphs at: pais) ejercitos - 2. (submorphs at: pais)
ejercitos: 2] ifFalse: [reagrupar _ (submorphs at: pais) ejercitos - 1.
(submorphs at: pais) ejercitos: 1].
n _ (submorphs at: pais)
misLimites size. batallon _ (reagrupar / n) asInteger. (submorphs at:
pais) misLimites do: [:index | (submorphs at: index) add:
batallon]]. ]! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc 3/27/2006
09:41'! fortificarWeb lim _ Array new: 2. lim at: 1 put: paisOrigen numero.
lim at: 2 put: paisDestino numero. (limites includes: lim) ifFalse: [lim at:
1 put: paisDestino numero. lim at: 2 put: paisOrigen numero. (limites
includes: lim) ifFalse: [self lastMorph: 'No son limitrofes'. ^
false]]. pone _ paisOrigen ejercitos - 1. paisOrigen ejercitos: 1. self
eligeEjercitos: pone jugador: playerTurn. self paisOrigen: nil. self estado:
2. ^true
! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc 3/24/2006
16:02'! guerraContra: paisAtacado
| dadoAtaque dadoDefensa elColor | cartel
contents: paisAtacante nombre , ' Ataca a ' , paisAtacado nombre. [paisAtacante
ejercitos > 0 and: [paisAtacado ejercitos > 0]] whileTrue: [dadoAtaque := 0.
dadoDefensa := 0. [dadoAtaque = dadoDefensa] whileTrue: [dadoAtaque := 6
atRandom. dadoDefensa := 6 atRandom]. dadoAtaque > dadoDefensa
ifTrue: [paisAtacado ejercitos: paisAtacado ejercitos - 1] ifFalse:
[paisAtacante ejercitos: paisAtacante ejercitos - 1]]. paisAtacado ejercitos =
0 ifTrue: [elColor := (losJugadores at: playerTurn) miColor. paisAtacado
color: elColor. (losJugadores at: paisAtacado deQuienSoy) misPaises
remove: paisAtacado numero ifAbsent: []. paisAtacado deQuienSoy:
playerTurn. (losJugadores at: paisAtacado deQuienSoy) misPaises size = 0
ifTrue: [self muerte]. paisAtacado deQuienSoy: playerTurn. (losJugadores
at: playerTurn) misPaises: paisAtacado numero] ifFalse: [^ false].
paisAtacante ejercitos > 2 ifTrue: [paisAtacado ejercitos: 2. pone :=
paisAtacante ejercitos - 2. paisAtacante ejercitos: 0. paisAtacante
normal. ^ true]. pone := 0. ^ false! ! !TEGMain methodsFor: 'game
sequence'! leerCartas | t1 t2 | mazo _ OrderedCollection new. t1 _
ReferenceStream fileNamed: 'cartas37.teg'. 1 to: 42 do: [:t3 |
t2 _ t1
next. (t2 submorphs at: 3) lock. mazo add: t2]. t1 close! ! !TEGMain
methodsFor: 'game sequence' stamp: 'edc 5/18/2006 11:49'! makeMove
[jugadoresVivos > 1] whileTrue: [submorphs do: [:t1 | t1 class ==
DrawPicture ifTrue: [t1 delete]]. (losJugadores at: playerTurn)
misPaises size = 0 ifTrue: [self muerte. self finRonda. playerTurn
_ playerTurn \\ 6 + 1] ifFalse: [self doCartel. done _ false.
estado _ 1.
ronda caseOf: { [1] -> [pone _ 5]. [2] ->
[pone _ 4]. [3] -> [pone _ 3]. [4] -> [pone _ 1]. [5] -> [pone
_ 1]} otherwise: [pone _ self cuantosEjercitos]. ronda > 5
ifTrue: [submorphs last class == InformaCartas ifTrue: [submorphs last
delete] ifFalse: [self addMorphBack: (InformaCartas new
initialize: losJugadores)]]. (losJugadores at: playerTurn) misCartas size
>= 3 & (losJugadores at: playerTurn) esHumano
ifTrue: [self verCartas].
(losJugadores at: playerTurn) esHumano
ifTrue: [self eligeEjercitos: pone
jugador: playerTurn] ifFalse: [self maquinaPone]. [done]
whileFalse: [World doOneCycle]. ((losJugadores at: playerTurn) esHumano
and: [estado = 3]) ifTrue: [self obtenerCarta]. self finRonda.
playerTurn _ playerTurn \\ 6 + 1]]! ! !TEGMain methodsFor: 'game sequence'
stamp: 'edc 5/17/2006 07:09'! maquinaPone | i n pais gano paises numpais |
done := false. n := (losJugadores at: playerTurn) misPaises size. i := 1.
paises := self submorphsSatisfying: [:t7 | t7 isKindOf: PaisMorph]. [pone >
0] whileTrue: [numpais := (losJugadores at: playerTurn) misPaises at: i.
pais := paises detect: [:p | p numero = numpais]. pais add: 1. pone
:= pone - 1. i := i + 1. i > n ifTrue: [i := 1]].
ronda > 5
ifTrue: [gano := self atacaMaquina. gano ifTrue: [self obtenerCarta]].
self continue
! ! !TEGMain methodsFor: 'game sequence'! muerte
(losJugadores at: playerTurn) vive: false. jugadoresVivos _ jugadoresVivos -
1! ! !TEGMain methodsFor: 'game sequence'! obtenerCarta | t1 | numCarta < 45
ifTrue: [t1 _ cartasOrden at: numCarta. (losJugadores at: playerTurn)
misCartas: t1. t1 > 42 ifTrue: [self dibujaUnaCarta2: (DrawCard new
dibujaUnaCarta: t1)] ifFalse: [self dibujaUnaCarta2: (mazo at: t1)]].
numCarta _ numCarta + 1! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc
11/11/2005 07:23'! permitido: t1
estado = 1 ifTrue: [((losJugadores at:
playerTurn) misPaises includes: t1) ifTrue: [^ true]]. estado = 2 | (estado
= 3) ifTrue: [lim ifNotNil: [(lim includes: t1) ifTrue: [^ true]]]. ^
false! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc 5/5/2006 11:43'!
statusFor: aString ^(self losJugadores at: playerTurn ifAbsent: []) nombre =
aString. ! ! !TEGMain methodsFor: 'game sequence' stamp: 'edc 5/4/2006
17:01'! suerte: x contra: paisAcacado
| dadoAtaque dadoDefensa elColor |
paisAtacante := x. ( cartel submorphs at: 1) contents: paisAtacante nombre ,
' Ataca a ' , paisAcacado nombre;color: (losJugadores at: playerTurn) miColor;
center: cartel center. [paisAtacante ejercitos > 0 and: [paisAcacado
ejercitos > 0]] whileTrue: [dadoAtaque := 0. dadoDefensa := 0.
[dadoAtaque = dadoDefensa] whileTrue: [dadoAtaque := 6 atRandom.
dadoDefensa := 6 atRandom]. dadoAtaque > dadoDefensa ifTrue: [paisAcacado
ejercitos: paisAcacado ejercitos - 1] ifFalse: [paisAtacante ejercitos:
paisAtacante ejercitos - 1]]. paisAcacado ejercitos = 0 ifTrue: [elColor :=
(losJugadores at: playerTurn) miColor. paisAcacado color: elColor.
(losJugadores at: paisAcacado deQuienSoy) misPaises remove: paisAcacado
numero ifAbsent: []. paisAcacado deQuienSoy: playerTurn. (losJugadores
at: paisAcacado deQuienSoy) misPaises size = 0 ifTrue: [self muerte].
paisAcacado deQuienSoy: playerTurn. (losJugadores at: playerTurn)
misPaises: paisAcacado numero] ifFalse: [^ false]. paisAtacante ejercitos > 2
ifTrue: [paisAcacado ejercitos: 2. pone := paisAtacante ejercitos - 2.
paisAtacante ejercitos: 0. ^ true]. pone := 0. ^ false. ! ! !TEGMain
methodsFor: 'game sequence' stamp: 'edc 10/19/2004 15:52'! verCartas | sold3
canon3 caba3 cambio soldado canon caballo resultado tipo laCarta | sold3 _ 0.
canon3 _ 0. caba3 _ 0. cambio _ 0. soldado _ 0. canon _ 0. caballo _ 0.
cambio _ 0. resultado _ false. 1 to: (losJugadores at: playerTurn) misCartas
size do: [:i |
laCarta _ (losJugadores at: playerTurn) misCartas at: i.
laCarta >= 43 ifTrue: [cambio _ cambio + 1. ]. tipo _ ((losJugadores
at: playerTurn) misCartas at: i) \\\ 3. tipo caseOf: { [0] ->
[sold3 _ sold3 + 1. soldado = 0 ifTrue: [soldado _ i. cambio _
cambio + 1] ]. [1] ->
[canon3 _ canon3 + 1. canon = 0
ifTrue: [canon _ i. cambio _ cambio + 1] ]. [2] ->
[caba3
_ caba3 + 1. caballo = 0 ifTrue: [caballo _ i. cambio _ cambio
+ 1] ]} otherwise: [Transcript open]]. sold3 >= 3 | (canon3 >= 3) |
(caba3 >= 3) | (cambio >= 3) ifTrue: [resultado _ true]. (losJugadores at:
playerTurn) misCartas size > 3 ifTrue: [resultado ifTrue: [self
optimizarCambio]]. "Si tengo mas de tres cartas, debo determinar si alguna es
de mis paises
y si la puedo cambiar" resultado ifTrue: [self dibuCartas:
(losJugadores at: playerTurn) misCartas size hayCambio: resultado]! !
!TEGMain
methodsFor: 'initialization' stamp: 'edc 5/16/2006 11:39'! addClient: aString
| nuevoJugador |
maxClient = 0 ifTrue:[^true].
aString ifNil: [self halt].
self losJugadores at: aString ifAbsent: [nuevoJugador := self losJugadores
at: maxClient. nuevoJugador nombre: aString. nuevoJugador esHumano: true.
nuevoJugador status: #pause. self losJugadores at: aString put: nuevoJugador.
maxClient := maxClient - 1. ( cartel submorphs at: 1) color: nuevoJugador
miColor. ( cartel submorphs at: 1) contents: aString , ' quiere jugar '.
]. maxClient = 0 ifTrue:[
self makeMove.
^false]. ^false ! !
!TEGMain methodsFor: 'initialization' stamp: 'edc 3/26/2006 06:41'!
cuantosEjercitos | sumEj sudAmerica norteAmerica europa asia oceania africa
paises | sumEj := 0. sudAmerica := 0. norteAmerica := 0. europa := 0. asia
:= 0. oceania := 0. africa := 0. paises := self submorphsSatisfying: [:t7
| t7 isKindOf: PaisMorph]. paises do: [:e | e deQuienSoy = playerTurn
ifTrue: [sumEj := sumEj + 1. (e numero >= 1 and: [e numero <= 4])
ifTrue: [sudAmerica := sudAmerica + 1]. (e numero >= 5 and: [e
numero <= 12]) ifTrue: [norteAmerica := norteAmerica + 1]. (e numero
>= 13 and: [e numero <= 20]) ifTrue: [europa := europa + 1].
(e numero >= 21 and: [e numero <= 33]) ifTrue: [asia := asia + 1].
(e numero >= 34 and: [e numero <= 37]) ifTrue: [oceania := oceania
+ 1]. (e numero > 38 and: [e numero < 42]) ifTrue: [africa :=
africa + 1]]]. sumEj := 1 + (sumEj / 3) asInteger.
(sudAmerica = 4 or:
[oceania = 4]) ifTrue: [sumEj := sumEj + 2]. (norteAmerica = 7 or: [europa
= 7]) ifTrue: [sumEj := sumEj + 5]. asia = 8 ifTrue: [sumEj := sumEj + 7].
africa = 5 ifTrue: [sumEj := sumEj + 3]. sumEj < 3 ifTrue: [sumEj := 3]. ^
sumEj! ! !TEGMain methodsFor: 'initialization' stamp: 'edc 10/8/2004 09:54'!
cuantosHumanos: aInteger
1 to: aInteger do: [:i| (losJugadores at: i)
esHumano: true ]. ! ! !TEGMain methodsFor: 'initialization' stamp: 'edc
5/6/2006 12:04'! distribuyePaises | randomNumber cantPaises ordendePaises
totalPaises cualPais paises elPais | paises := TEGMain current
submorphsSatisfying: [:t7 | t7 isKindOf: PaisMorph]. cantPaises _ 42 /
jugadoresVivos. ordendePaises _ OrderedCollection new. [ordendePaises size <
42] whileTrue: [(ordendePaises includes: (randomNumber _ 42 atRandom))
ifFalse: [ordendePaises add: randomNumber]]. totalPaises _ 1. 1 to:
jugadoresVivos do: [:elJugador | 1 to: cantPaises do: [:p |
cualPais _ ordendePaises at: totalPaises. elPais := paises detect: [:p2
| p2 numero = cualPais]. (losJugadores at: elJugador) misPaises:
cualPais. elPais deQuienSoy: elJugador;ejercitos: 0. totalPaises
_ totalPaises + 1]]! ! !TEGMain methodsFor: 'initialization'! elijeColor | t1
t2 t3 | t1 _ Array new: 16. t1 at: 1 put: (Color r: 1.0 g: 5000 /
65535 b: 5000 / 65535). t1 at: 2 put: (Color r: 1.0 g: 25000 /
65535 b: 5000 / 65535). t1 at: 3 put: (Color r: 1.0 g: 45000 /
65535 b: 5000 / 65535). t1 at: 4 put: (Color r: 65000 / 65535
g: 65000 / 65535 b: 25000 / 65535). t1 at: 5 put: (Color r: 65000 /
65535 g: 65000 / 65535 b: 500 / 65535). t1 at: 6 put: (Color r:
45000 / 65535 g: 45000 / 65535 b: 500 / 65535). t1 at: 7 put:
(Color r: 25000 / 65535 g: 25000 / 65535 b: 500 / 65535). t1 at:
8 put: (Color r: 5000 / 65535 g: 65535 / 65535 b: 20000 / 65535).
t1 at: 9 put: (Color r: 5000 / 65535 g: 65535 / 65535 b: 65535 /
65535). t1 at: 10 put: (Color r: 5000 / 65535 g: 45000 / 65535
b: 65535 / 65535). t1 at: 11 put: (Color r: 5000 / 65535 g: 25000 /
65535 b: 65535 / 65535). t1 at: 12 put: (Color r: 5000 / 65535
g: 5000 / 65535 b: 65535 / 65535). t1 at: 13 put: (Color r: 1.0
g: 5000 / 65535 b: 25000 / 65535). t1 at: 14 put: (Color r: 1.0
g: 5000 / 65535 b: 45000 / 65535). t1 at: 15 put: (Color r: 1.0
g: 5000 / 65535 b: 65000 / 65535). t1 at: 16 put: (Color r: 45000 /
65535 g: 5000 / 65535 b: 65535 / 65535). t2 _ AlignmentMorph newColumn.
t3 _ OrderedCollection new. 1 to: 16 do: [:t4 | t3 add: (SimpleButtonMorph
new label: 'Color ';
color: (t1 at: t4); target: self;
actionSelector: #miColor:;
arguments: (Array with: (t1 at:
t4)))]. t3 reverseDo: [:t5 | t2 addMorph: t5]. t2 position: 650 @ 30. self
addMorph: t2. cartel _ t2! ! !TEGMain methodsFor: 'initialization' stamp: 'edc
5/6/2006 07:34'! howManyPlayers maxClient := 0. [maxClient between: 1 and: 5]
whileFalse: [maxClient := (FillInTheBlank request: 'How many players 1 - 5')
asInteger]. self cuantosHumanos: maxClient. losJugadores := Dictionary new. 1
to: 6 do: [:t2 |
losJugadores at: t2 put: Jugador new. (losJugadores
at: t2) nombre: 'maquina' , t2 asString]. jugadoresVivos := 6.! ! !TEGMain
methodsFor: 'initialization'! informaCartas self halt. self addMorphBack:
(InformaCartas new initialize: losJugadores)! ! !TEGMain methodsFor:
'initialization' stamp: 'edc 5/20/2006 16:05'! initialize4
self
howManyPlayers. botones := Dictionary new. self shuffleCards.
self
distribuyePaises. self miColor. ronda := 1. estado := 1. numCarta := 1.
playerTurn := 1. cambiosTotales := 0. self puedeAtacar: false. done := false.
self suspendEventHandler! ! !TEGMain methodsFor: 'initialization'! leerArchivo
| t1 t2 | t2 _ String new. [miArchivo atEnd] whileFalse: [t1 _ miArchivo
next asCharacter. t1 asciiValue = 13 ifTrue: [^ t2]. t2 _ t2 , t1
asString]! ! !TEGMain methodsFor: 'initialization' stamp: 'edc 10/21/2004
12:11'! miColor | t1 t2 paises | t1 := Color wheel: 6 saturation: 0.7
brightness: 0.9. t2 := 1. t1 do: [:t3 |
(losJugadores at: t2)
miColor: t3. t2 := t2 + 1]. paises := self submorphs select: [:p | p
isKindOf: PaisMorph] thenCollect:[ :any| any]. paises do: [:t4 | t4 color:
(losJugadores at: t4 deQuienSoy) miColor. t4 mostrar]! ! !TEGMain
methodsFor: 'initialization'! miColor: t1
1 to: 6 do: [:t2 | (losJugadores
at: t2) miColor ifNil: [(losJugadores at: t2) miColor: t1.
(losJugadores at: t2) misPaises do: [:t3 | (submorphs at: t3)
color: t1]. t2 = 6 ifTrue: [cartel delete. cartel _ TextMorph
borderedPrototype. cartel beAllFont: (StrikeFont familyName:
#ComicBold size: 18). cartel color: Color red. cartel newContents:
'SqueakRos fight the evil '. cartel extent: self width - 30 @ 40.
cartel center: self center. cartel top: self top + 10. self
addMorphBack: cartel. self startStepping. self makeMove]. ^
t2]]! ! !TEGMain methodsFor: 'initialization' stamp: 'edc 5/6/2006 07:32'!
shuffleCards | newCard | cartasOrden := OrderedCollection new. [cartasOrden
size < 44] whileTrue: [(cartasOrden includes: (newCard := 44 atRandom))
ifFalse: [cartasOrden add: newCard]].! ! !TEGMain methodsFor: 'initialization'
stamp: 'edc 5/8/2006 07:27'! verificarCambio: cardDialog
| cambio soldado
canon caballo dibujo | soldado _ 0. canon _ 0. caballo _ 0.
cambio _
cardDialog submorphs count: [:m | m class name = 'DrawCard' and: [m
submorphs first estado = true]]. cambio > 3 ifTrue: [ cartel string:
'Tramposo '. cartel center: cardDialog center. cardDialog addMorph:
cartel]. dibujo _ cardDialog submorphs select: [:m | m class name =
'DrawCard' and: [m submorphs first estado = true]] thenCollect: [:each
| each numero \\\ 3]. cambio _ 0. dibujo do: [:tipo | tipo caseOf: { [0]
->
[soldado = 0 ifTrue: [soldado _ 1. cambio _ cambio + 1]].
[1] ->
[canon = 0 ifTrue: [canon _ 1. cambio _ cambio + 1]].
[2] ->
[caballo = 0 ifTrue: [caballo _ 1. cambio _ cambio +
1]]} otherwise: [Transcript open]]. dibujo _ cardDialog submorphs
select: [:m | m class name = 'DrawCard' and: [m submorphs first estado =
true]] thenCollect: [:each | each numero >42 ifTrue: [cambio _ cambio + 1
]].
cambio = 3 ifTrue: [^ true] ifFalse: ["(StreamingMP3Sound onFileNamed:
NewFolder pathName , FileDirectory slash , 'tramposo.mp3') play." cartel
string: 'Tramposo '. cartel center: cardDialog center. cardDialog
addMorph: cartel. self halt]! !
!TEGMain methodsFor: 'menus'!
addCustomMenuItems: t1 hand: t2
super addCustomMenuItems: t1 hand: t2. t1
addLine. self addMenuItemsTo: t1 hand: t2! ! !TEGMain methodsFor: 'menus'!
addMenuItemsTo: t1 hand: t2
t1 add: 'new game' target: self action:
#newGame. t1 add: 'reset...' target: self action: #reset. t1 add:
'grabar estado' target: self action: #grabaEstado. t1 add: 'leer estado'
target: self action: #leerEstado. t1 add: 'debug' target: self action:
#debug! ! !TEGMain methodsFor: 'menus' stamp: 'EDC 6/26/2002 07:50'!
cambiaCartas: cardDialog
| tengo cambios hagaCambio | estado _ 4. cambios _
#(4 6 8 10 12 15 ). (losJugadores at: playerTurn) esHumano ifTrue:
[hagaCambio _ self verificarCambio: cardDialog] ifFalse: [hagaCambio _ true].
cardDialog submorphs do: [:m | m class name = 'DrawCard' ifTrue: [m
submorphs first estado ifTrue: [tengo _ (losJugadores at: playerTurn)
misPaises includes: m numero. tengo ifTrue: [(submorphs at: m
numero) add: 2]. (losJugadores at: playerTurn) misCartas
remove: m numero ifAbsent: []]]]. cambiosTotales _ cambiosTotales +
1. cambiosTotales < 7 ifTrue: [pone _ pone + cambios at: cambiosTotales]
ifFalse: [pone _ pone + 15 + 5 * (cambiosTotales - 6)]. cardDialog delete. ! !
!TEGMain methodsFor: 'menus' stamp: 'EDC 6/27/2002 16:05'! hacerListaPaises:
aBoolean | misLimites listaLimpia | misLimites _ Set new. "Deseo la lista
total de los paises limitrofes a mis paises" (losJugadores at: playerTurn)
misPaises do: [:pais | limites do: [:each | (each includes: pais)
ifTrue: [misLimites add: each]]].
listaLimpia _ misLimites copy. aBoolean
ifTrue: [ "Debo eliminar de la lista las fronteras de paises que ambos me
pertenezcan" misLimites do: [:frontera | (((losJugadores at: playerTurn)
misPaises includes: (frontera at: 1)) and: [(losJugadores at:
playerTurn) misPaises includes: (frontera at: 2)]) ifTrue:
[listaLimpia remove: frontera]] ] ifFalse: [ "Debo eliminar de la lista las
fronteras de paises que ambos me
pertenezcan" misLimites do: [:frontera |
(((losJugadores at: playerTurn) misPaises includes: (frontera at: 1))
and: [(losJugadores at: playerTurn) misPaises includes: (frontera at:
2)]) ifFalse: [listaLimpia remove: frontera]]]. . ^ listaLimpia ! !
"--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TEGMain class
instanceVariableNames: 'current zero'! !TEGMain class methodsFor: 'as yet
unclassified'! debug self maquinaPone! ! !TEGMain class methodsFor: 'as yet
unclassified'! makeRTS: t1
| t2 t3 | t1 delete. Preferences disable:
#cmdDotEnabled; disable: #cmdGesturesEnabled; disable: #cmdKeysInText;
enable: #noviceMode; disable: #warnIfNoSourcesFile; disable:
#warnIfNoChangesFile; enable: #eToyFriendly; disable:
#honorDesktopCmdKeys; enable: #appendToErrorLog; enable: #noDebugButton.
t2 _ FileDirectory localNameFor: Smalltalk imageName. t3 _ (t2 copyFrom: 1
to: (t2 findString: '.image')) , 'RTS.image'. Smalltalk
changeImageNameTo: (FileDirectory default fullNameFor: t3); closeSourceFiles;
openSourceFiles; snapshot: true andQuit: true! ! !TEGMain class methodsFor:
'as yet unclassified' stamp: 'edc 5/6/2006 08:34'! reset "For start the game
with all variables on intiial state. TEGMain reset" self current:self zero
openCenteredInWorld . self current initialize4. ^ self current! ! !TEGMain
class methodsFor: 'as yet unclassified' stamp: 'edc 5/7/2006 15:09'! zero ^zero
copy! ! !TEGMain class methodsFor: 'as yet unclassified' stamp: 'edc 5/6/2006
07:07'! zero: aMorph zero := aMorph! !
!TEGMain class methodsFor: 'instance
creation' stamp: 'edc 4/28/2006 07:37'! current ^current! ! !TEGMain class
methodsFor: 'instance creation' stamp: 'edc 4/28/2006 07:38'! current: anObject
current := anObject! !
HVRootView subclass: #TEGServerRoot
instanceVariableNames: '' classVariableNames: '' poolDictionaries: ''
category: 'Morphic-TEG'! !TEGServerRoot methodsFor: 'start/stop' stamp: 'edc
3/14/2006 08:47'! startOn: portNum mode: mode
"Creates a new standalone http
service with this root view
plugged in." | name ma authdb| Transcript clear.
name := viewClass ifNil: [self class name] ifNotNil: [viewClass name].
ma := ModuleAssembly core. coreMod := ma currentModule.
ma logTo:
(KomLogger on: Transcript). authdb := KomAuthDb new. authdb addUser:
'edgar' withPassword: 'squeak'. authdb addUser: 'luciano' withPassword: 'teg'.
authdb addUser: 'ale' withPassword: 'srv'. authdb addUser: 'carla'
withPassword: 'utn'. authdb addUser: 'guest' withPassword: ''. ma
authenticate: authdb realm: 'TEG'. ma trackSessions. sessionMod := ma
currentModule. ma sessionTimeout: 1. alias = '' ifTrue: [ma addPlug:
[:request | self process: request]] ifFalse: [ma alias: alias to: [ma
addPlug: [:request | self process: request]]]. ^ (HttpService startOn: portNum
named: name) plug: ma rootModule; mode: mode! !
Object subclass: #TEGWeb
instanceVariableNames: 'ip' classVariableNames: '' poolDictionaries: ''
category: 'Morphic-TEG'! !TEGWeb commentStamp: '<historical>' prior: 0! TEGWeb
new TEGWeb stop!
!TEGWeb methodsFor: 'as yet unclassified' stamp: 'edc
5/20/2006 10:22'! decide | method start status | start := TEGMain current
addClient: ModAuth user. start ifFalse: [^ self pause] ifTrue:
[ status := TEGMain current statusFor: ModAuth user .
status ifFalse: [^self pause] ifTrue: [method := HttpRequest
current url .
method := method copyFrom:2 to:
method size. method = 'favicon.ico' ifFalse: [
method size = 0 ifFalse: [(self perform: method asSymbol) ]]]].
status := TEGMain current statusFor: ModAuth user . status
ifFalse: [^self pause] ifTrue:[^self step]! ! !TEGWeb methodsFor: 'as
yet unclassified' stamp: 'edc 5/20/2006 10:07'! initialize | ma authdb t3 |
Socket initializeNetwork. self ip: NetNameResolver localAddressString. TEGMain
reset.
authdb := KomAuthDb new. authdb addUser: 'edgar' withPassword:
'squeak'. authdb addUser: 'luciano' withPassword: 'teg'. authdb addUser: 'ale'
withPassword: 'srv'. authdb addUser: 'carla' withPassword: 'utn'. authdb
addUser: 'guest' withPassword: ''.
ma := ModuleAssembly core. ma
authenticate: authdb realm: 'TEG'. ma logTo: (KomLogger on: Transcript).
ma alias: '/teg' to: [ma addPlug: [:t2 | HttpResponse fromMIMEDocument:
TEGMain current grabaFoto asWebImage]]. ma addPlug: [:t2 |
t2 fields size
= 0 ifFalse: [t3 := Point x: (t2 fields at: 'point.x') y:
(t2 fields at: 'point.y'). TEGMain current click: t3]. HttpResponse
fromString: self decide]. ^ (HttpService startOn: 8000 named: 'TEG') plug: ma
rootModule;setDebugMode! ! !TEGWeb methodsFor: 'as yet unclassified' stamp:
'edc 5/17/2006 06:54'! pause
^ '<HTML> <HEAD> <TITLE>Squeak TEG</TITLE>
</HEAD> <meta http-equiv="Refresh" content="10" > <BODY>
<br> <img
src="http://',ip,':8000/teg"> <br> <h3>You are in pause now </h3>
</BODY>
</HTML>'! ! !TEGWeb methodsFor: 'as yet unclassified' stamp: 'edc 5/17/2006
07:02'! step
^ '<HTML> <HEAD> <TITLE>TEGWeb</TITLE> </HEAD> <BODY> <form>
<img src="http://',ip,':8000/teg" usemap="#Map">
<map name="Map"> <area
shape="poly"
coords="132,420,74,454,73,462,85,471,62,469,57,460,61,451,89,379,103,387,111,385\
,131,401" href="argentina"> <area shape="rect" coords= "102,454,147 ,468 "
href="ataque "> <area shape="rect" coords= "225,454,292 ,468 " href="finataque
"> <area shape="rect" coords= "367,454,431 ,468 " href="continuar "> <area
shape="rect" coords= "508,454,568 ,468 " href="fortificar "> <area shape="rect"
coords= "643,454,684 , 468" href="debug "> <area shape="rect" coords=
"200,420,240 , 440" href="boton1 "> <area shape="rect" coords= "245,420,285 ,
440" href="boton2 "> <area shape="rect" coords= "290,420,330 , 440" href="boton3
"> <area shape="rect" coords= "335,420,375 , 440" href="boton4 "> <area
shape="rect" coords= "380,420,420 , 440" href="boton5 "> <area shape="rect"
coords= "425,465,465 , 440" href="boton6 "> <area shape="rect" coords=
"470,420,510 , 440" href="boton7 "> <area shape="rect" coords= "515,420,555 ,
440" href="boton8 "> <area shape="rect" coords= "560,420,600 , 440" href="boton9
">
<area shape="poly" coords="69 ,316 ,97 ,324 ,99 ,332 ,100 ,340 ,111 ,351
,133 ,374 ,129 ,393 ,115 ,382 ,92 ,378 ,68 ,354 ,69 ,317" href="peru "> <area
shape="poly" coords="62 ,324 ,202 ,341 ,212 ,354 ,179 ,392 ,164 ,390 ,137 ,417
,135 ,396 ,139 ,375 ,115 ,350 ,101 ,333 ,120 ,320" href="brasil "> <area
shape="poly" coords=" 84 ,293 ,103 ,291 ,115 ,300 ,125 ,296 ,158 ,314 ,161 ,321
,124 ,318 ,105 ,325 ,72 ,313 ,80 ,299 ,85 ,292" href="venezuela "> <area
shape="poly" coords=" 50 ,228 ,78 ,226 ,97 ,241 ,97 ,255 ,112 ,260 ,111 ,275
,114 ,295 ,105 ,288 ,79 ,265 ,66 ,263 ,47 ,241 " href="mexico">
<area
shape="poly" coords=" 129 ,192 ,154 ,193 ,175 ,215 ,193 ,208 ,223 ,209 ,174 ,228
,144 ,237 ,149 ,257 ,140 ,256 ,125 ,246 ,100 ,245 " href="florida">
<area
shape="poly" coords=" 48 ,180 ,126 ,192 ,121 ,201 ,113 ,210 ,108 ,219 ,100 ,227
,95 ,237 ,77 ,224 ,50 ,225 ,40 ,215 ,41 ,197 " href="california">
<area
shape="poly" coords=" 58 ,139 ,123 ,143 ,120 ,189 ,49 ,177 ,47 ,173 ,44 ,163 ,53
,158 ,61 ,153 ,61 ,139 ,82 ,138 ,104 ,140 " href="oregon">
<area shape="poly"
coords=" 128 ,141 ,168 ,143 ,178 ,152 ,170 ,168 ,189 ,181 ,183 ,205 ,174 ,210
,158 ,190 ,125 ,187 ,125 ,168 ,125 ,151 " href="newyork">
<area shape="poly"
coords=" 204 ,153 ,213 ,153 ,218 ,164 ,229 ,161 ,235 ,170 ,251 ,173 ,252 ,179
,237 ,186 ,224 ,196 ,215 ,205 ,186 ,201 " href="labrador">
<area shape="poly"
coords=" 10 ,88 ,41 ,77 ,62 ,90 ,63 ,135 ,54 ,139 ,58 ,151 ,45 ,157 ,49 ,147 ,40
,131 ,18 ,136 ,15 ,115 " href="alaska">
<area shape="poly" coords=" 66 ,92
,93 ,92 ,131 ,106 ,161 ,111 ,184 ,99 ,205 ,115 ,187 ,137 ,66 ,136 ,65 ,118 ,64
,99 ,65 ,93 " href="yukon">
<area shape="poly" coords=" 293 ,56 ,314 ,76 ,284
,136 ,314 ,105 ,269 ,147 ,260 ,133 ,250 ,110 ,240 ,92 ,227 ,90 ,236 ,76 ,246 ,54
" href="groenland">
<area shape="poly" coords=" 268 ,159 ,274 ,156 ,279 ,155
,288 ,158 ,292 ,164 ,291 ,169 ,287 ,172 ,281 ,174 ,274 ,174 ,267 ,168 ,263 ,162
" href="island">
<area shape="poly" coords=" 300 ,164 ,314 ,157 ,329 ,157
,336 ,183 ,330 ,207 ,319 ,204 ,308 ,216 ,300 ,217 ,286 ,218 ,280 ,201 ,298 ,185
" href="scandinav">
<area shape="poly" coords=" 333 ,158 ,347 ,160 ,351 ,169
,389 ,147 ,393 ,177 ,389 ,207 ,367 ,225 ,359 ,267 ,315 ,249 ,313 ,232 ,321 ,222
" href="germany">
<area shape="poly" coords=" 291 ,230 ,309 ,230 ,312 ,239
,314 ,246 ,306 ,249 ,299 ,251 ,292 ,257 ,286 ,253 ,279 ,248 ,280 ,242 ,285 ,237
" href="france">
<area shape="poly" coords=" 278 ,235 ,273 ,241 ,266 ,238
,260 ,239 ,259 ,244 ,253 ,239 ,253 ,232 ,259 ,228 ,261 ,219 ,268 ,217 ,275 ,223
" href="britain">
<area shape="poly" coords=" 277 ,248 ,266 ,253 ,267 ,261
,249 ,262 ,245 ,267 ,254 ,281 ,265 ,279 ,272 ,268 ,288 ,268 ,294 ,260 ,285 ,254
" href="espania">
<area shape="poly" coords=" 292 ,268 ,295 ,263 ,300 ,255
,307 ,252 ,313 ,251 ,321 ,255 ,327 ,262 ,323 ,266 ,319 ,270 ,310 ,269 ,304 ,282
" href="italia">
<area shape="poly" coords=" 393 ,146 ,397 ,175 ,394 ,202
,408 ,203 ,428 ,210 ,441 ,222 ,447 ,228 ,453 ,221 ,446 ,154 ,431 ,103 ,415 ,134
" href="rusia">
<area shape="poly" coords=" 367 ,226 ,390 ,210 ,407 ,205 ,426
,212 ,440 ,225 ,443 ,236 ,426 ,249 ,423 ,265 ,403 ,271 ,386 ,268 ,365 ,268 "
href="mongolia">
<area shape="poly" coords=" 319 ,274 ,329 ,260 ,361 ,270
,371 ,282 ,393 ,301 ,368 ,311 ,341 ,293 ,339 ,281 ,334 ,275 ,327 ,275 ,323 ,273
" href="turquia">
<area shape="poly" coords=" 369 ,273 ,386 ,271 ,420 ,270
,439 ,268 ,452 ,271 ,454 ,276 ,452 ,282 ,435 ,308 ,429 ,310 ,420 ,299 ,388 ,289
" href="india">
<area shape="poly" coords=" 503 ,100 ,466 ,100 ,464 ,110 ,439
,113 ,444 ,137 ,448 ,169 ,454 ,222 ,462 ,225 ,471 ,220 ,484 ,190 ,482 ,156 "
href="gobi">
<area shape="poly" coords=" 533 ,96 ,508 ,100 ,496 ,126 ,484
,154 ,499 ,158 ,514 ,155 ,530 ,162 ,531 ,173 ,546 ,173 ,561 ,145 ,570 ,109 "
href="tamir">
<area shape="poly" coords=" 571 ,107 ,581 ,103 ,595 ,107 ,593
,124 ,586 ,152 ,575 ,167 ,572 ,195 ,562 ,199 ,554 ,179 ,549 ,173 ,557 ,160 "
href="kamchatka">
<area shape="poly" coords=" 486 ,158 ,502 ,162 ,514 ,157
,528 ,163 ,529 ,174 ,522 ,187 ,514 ,196 ,516 ,210 ,477 ,217 ,480 ,204 ,489 ,183
" href="siberia">
<area shape="poly" coords=" 435 ,247 ,451 ,228 ,464 ,227
,474 ,228 ,483 ,235 ,499 ,238 ,508 ,242 ,516 ,248 ,510 ,267 ,499 ,276 ,426 ,263
" href="china">
<area shape="poly" coords=" 515 ,212 ,484 ,217 ,478 ,222 ,479
,229 ,488 ,233 ,497 ,235 ,510 ,242 ,517 ,247 ,523 ,250 ,527 ,232 ,518 ,227 "
href="tsamir">
<area shape="poly" coords=" 531 ,177 ,542 ,175 ,549 ,177 ,545
,186 ,535 ,191 ,537 ,215 ,532 ,230 ,521 ,229 ,518 ,213 ,515 ,201 ,523 ,190 "
href="aral">
<area shape="poly" coords=" 555 ,215 ,566 ,214 ,568 ,219 ,563
,226 ,562 ,242 ,554 ,251 ,547 ,267 ,541 ,267 ,542 ,259 ,547 ,247 ,554 ,234 "
href="japon">
<area shape="poly" coords=" 455 ,271 ,473 ,271 ,485 ,277 ,495
,280 ,500 ,291 ,494 ,299 ,483 ,297 ,499 ,316 ,494 ,321 ,470 ,305 ,458 ,291 "
href="malasia">
<area shape="poly" coords=" 482 ,322 ,491 ,322 ,498 ,320 ,505
,318 ,511 ,315 ,517 ,325 ,526 ,329 ,528 ,338 ,518 ,341 ,510 ,345 ,490 ,347 "
href="sumatra">
<area shape="poly" coords=" 546 ,327 ,557 ,328 ,571 ,328 ,584
,333 ,586 ,344 ,572 ,344 ,562 ,341 ,555 ,340 ,545 ,339 ,538 ,335 ,541 ,328 "
href="newzeland">
<area shape="poly" coords=" 544 ,352 ,551 ,347 ,563 ,352
,572 ,352 ,589 ,360 ,589 ,376 ,586 ,390 ,571 ,395 ,541 ,391 ,537 ,379 ,541 ,373
" href="eastocean">
<area shape="poly" coords=" 515 ,362 ,528 ,351 ,540 ,354
,539 ,371 ,533 ,378 ,537 ,392 ,532 ,400 ,517 ,404 ,499 ,391 ,494 ,380 ,509 ,372
" href="westocean">
<area shape="poly" coords=" 239 ,286 ,287 ,285 ,280 ,295
,278 ,303 ,306 ,319 ,313 ,338 ,317 ,360 ,283 ,358 ,248 ,344 ,221 ,331 ,216 ,310
" href="sahara">
<area shape="poly" coords=" 291 ,290 ,332 ,290 ,349 ,303
,322 ,307 ,314 ,313 ,310 ,318 ,296 ,312 ,284 ,304 ,281 ,298 ,285 ,293 ,288 ,291
" href="egipto">
<area shape="poly" coords=" 325 ,360 ,315 ,337 ,312 ,326
,315 ,316 ,324 ,312 ,334 ,307 ,352 ,308 ,360 ,315 ,374 ,318 ,355 ,344 ,350 ,365
" href="etiopia">
<area shape="poly" coords=" 283 ,364 ,325 ,366 ,336 ,373
,351 ,368 ,344 ,384 ,336 ,400 ,320 ,410 ,303 ,409 ,292 ,393 ,293 ,381 ,281 ,375
" href="sudafrica">
<area shape="poly" coords=" 360 ,375 ,367 ,374 ,371 ,372
,379 ,378 ,371 ,386 ,368 ,395 ,370 ,406 ,363 ,411 ,352 ,410 ,350 ,401 ,355 ,385
" href="madagascar"> </map> </form>
</BODY> <h3><br> ', TEGMain current
lastMorph printString,'</br> </h3></HTML>'! !
!TEGWeb methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:03'! alaska ^self cualPais: 'Alaska'! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:19'! aral ^self cualPais: 'Aral'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:04'! argentina ^self
cualPais: 'Argentina'
! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
10:05'! ataque TEGMain current ataque. ^ self redirectTo: #step! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton1 | losboton miboton |
losboton := TEGMain current botones. miboton := losboton at: 1.
^ self
switchButton: miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
09:27'! boton2 | losboton miboton | losboton := TEGMain current botones.
miboton := losboton at: 2. ^ self switchButton: miboton! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/24/2006 09:27'! boton3 | losboton miboton | losboton :=
TEGMain current botones. miboton := losboton at: 3. ^ self switchButton:
miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton4 |
losboton miboton | losboton := TEGMain current botones. miboton := losboton
at: 4. ^ self switchButton: miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc
5/8/2006 09:05'! boton5 | losboton miboton | losboton := TEGMain current
botones. miboton := losboton at: 5.
^ self switchButton: miboton! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 09:27'! boton6 | losboton miboton |
losboton := TEGMain current botones. miboton := losboton at: 6. ^ self
switchButton: miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
09:27'! boton7 | losboton miboton | losboton := TEGMain current botones.
miboton := losboton at: 7. ^ self switchButton: miboton! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/24/2006 09:27'! boton8 | losboton miboton | losboton :=
TEGMain current botones. miboton := losboton at: 8. ^ self switchButton:
miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 09:28'! boton9 |
losboton miboton | losboton := TEGMain current botones. miboton := losboton
at: 9. ^ self switchButton: miboton! ! !TEGWeb methodsFor: 'urls' stamp: 'edc
3/24/2006 08:04'! brasil ^self cualPais: 'Brasil'. ! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/26/2006 08:39'! britain ^self cualPais: 'Britain'.! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 3/26/2006 08:36'! california ^self
cualPais: 'California'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/26/2006
08:36'! china ^self cualPais: 'China'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 5/4/2006 17:24'! continuar TEGMain current continue. ^ self step! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 5/16/2006 11:59'! cualPais: aString
|
paises elPais | paises := TEGMain current submorphsSatisfying: [:t7 | t7
isKindOf: PaisMorph]. elPais := paises detect: [:p | p nombre = aString].
TEGMain current lastMorph: elPais. elPais clickWeb. TEGMain current pone = 0
ifTrue: [^ HttpResponse redirectTo: #pause] ifFalse: [^ HttpResponse
redirectTo: #step]! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 5/20/2006 16:10'!
debug self halt.! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/25/2006 18:00'!
eastocean ^self cualPais: 'EastOcean'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 3/24/2006 08:25'! egipto ^self cualPais: 'Egipto'! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 5/20/2006 10:44'! espania ^self cualPais: 'Espa–a'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 5/20/2006 10:45'! etiopia ^self
cualPais: 'Etiop’a'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/30/2006 11:55'!
finAtaque TEGMain current fortificar. ^ self redirectTo: #step! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/30/2006 11:57'! finataque TEGMain current
fortificar. ^ self redirectTo: #step! ! !TEGWeb methodsFor: 'urls' stamp: 'edc
3/24/2006 08:05'! florida ^self cualPais: 'Florida'! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/27/2006 09:07'! fortificar TEGMain current fortificar. ^
self redirectTo: #step! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
08:27'! france ^self cualPais: 'France'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 3/24/2006 08:06'! germany ^self cualPais: 'Germany'! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:27'! gobi ^self cualPais: 'Gobi'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:06'! groenland ^self
cualPais: 'Groenland'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
08:27'! india ^self cualPais: 'India'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 3/24/2006 08:06'! island ^self cualPais: 'Island'! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/24/2006 08:28'! italia ^self cualPais: 'Italia'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 5/20/2006 10:44'! japon ^self cualPais:
'Jap—n'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:28'! kamchatka
^self cualPais: 'Kamchatka'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
08:29'! labrador ^self cualPais: 'Labrador'! ! !TEGWeb methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:29'! madagascar ^self cualPais: 'Madagascar'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:29'! malasia ^self
cualPais: 'Malasia'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:06'!
mexico ^self cualPais: 'Mexico'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc
3/24/2006 08:30'! mongolia ^self cualPais: 'Mongolia'! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/30/2006 11:36'! newyork ^self cualPais: 'NewYork'! !
!TEGWeb methodsFor: 'urls' stamp: 'edc 3/26/2006 08:20'! newzeland ^self
cualPais: 'NewZeland'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
08:07'! oregon ^self cualPais: 'Oregon'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 3/24/2006 08:07'! peru ^self cualPais: 'Peru'! ! !TEGWeb methodsFor:
'urls' stamp: 'edc 3/24/2006 08:30'! rusia ^self cualPais: 'Rusia'! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:31'! sahara ^self cualPais:
'Sahara'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:31'! scandinav
^self cualPais: 'Scandinav'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006
08:31'! siberia ^self cualPais: 'Siberia'! ! !TEGWeb methodsFor: 'urls' stamp:
'edc 3/24/2006 08:03'! sudafrica ^self cualPais: 'Sudafrica'! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:32'! sumatra ^self cualPais:
'Sumatra'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 5/6/2006 11:42'!
switchButton: aButton
aButton setSwitchState: aButton estado not. TEGMain
current lastMorph: aButton.
! ! !TEGWeb methodsFor: 'urls' stamp: 'edc
3/24/2006 08:32'! tamir ^self cualPais: 'Tamir'! ! !TEGWeb methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:32'! tsamir ^self cualPais: 'Tsamir'! ! !TEGWeb
methodsFor: 'urls' stamp: 'edc 3/24/2006 08:32'! turquia ^self cualPais:
'Turquia'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/24/2006 08:07'! venezuela
^self cualPais: 'Venezuela'! ! !TEGWeb methodsFor: 'urls' stamp: 'edc 3/25/2006
18:00'! westocean ^self cualPais: 'WestOcean'! ! !TEGWeb methodsFor: 'urls'
stamp: 'edc 3/24/2006 08:08'! yukon ^self cualPais: 'Yukon'! !
!TEGWeb
methodsFor: 'accessing' stamp: 'edc 5/17/2006 06:52'! ip "Answer the value of
ip"
^ ip! ! !TEGWeb methodsFor: 'accessing' stamp: 'edc 5/17/2006 06:52'! ip:
anObject "Set the value of ip"
ip := anObject! ! "-- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- "! TEGWeb class instanceVariableNames: ''! !TEGWeb
class methodsFor: 'start/stop' stamp: 'edc 5/5/2006 06:43'! stop
(ApplicationService serviceNamed: 'TEG') unregister.! !
|