| Class Terrain |
|
This is the terrain class. Different terrains will have different dificulties to walk (for example, a dragoon will go much faster on plains than on swamp). Different terrains will also have different production. There are some special types of terrain: sea, for example, can only be crossed by ship.
| Methods |
| Attributes |
| defense_bonus | [R] | Defense bonus if a unit is attacked in this terrain (%). |
| deforested_becomes | [R] | If it goes deforested, what does it becomes? |
| good_production | [RW] | How much it produces of each good? (Hash) |
| move_cost_to_enter | [R] | Movement points spent for a unit to enter this terrain. |
| name | [R] | Terrain name (string). It‘ll show in the status bar. |
| Public Class methods |
| new(name, move_cost_to_enter, defense_bonus, deforested_becomes) |
Sets up the terrain
# File terrain.rb, line 21 def initialize (name, move_cost_to_enter, defense_bonus, deforested_becomes) @name = name @move_cost_to_enter = move_cost_to_enter @defense_bonus = defense_bonus @deforested_becomes = deforested_becomes @good_production = Hash.new end