Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[LINK] Ruby DSL for turn-based strategy game
Dr Nic
9/7/2006 9:34:00 AM
"I continue to develop Dr Nicâ??s Civilizations game. This lead me to
develop a DSL for the specification of game rules. You need to see this.
"Hereâ??s an example definition of some terrain:
class Desert < Terrain
title "Desert"
letter "d"
graphic "desert"
movement_cost 1
defense_bonus 10
food 0
shield 1
trade 0
end
class Oasis < Desert
title "Oasis"
special_code 1
food 3
shield 1
trade 0
graphic "oasis"
end
"An Oasis is a special version of the Desert terrain, so Ruby subclasses
offer a compatible relationship."
I've written up why I used a Ruby DSL for this static configuration, and
how it is implemented here:
http://drnicwilliams.com/2006/09/07/turn-based...
Cheers
Nic
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[LINK] Ruby DSL for turn-based strategy game
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password