Class: Oolite::Configuration
- Inherits:
-
Object
- Object
- Oolite::Configuration
- Defined in:
- lib/oolite.rb
Instance Attribute Summary collapse
-
#cargo ⇒ Object
Returns the value of attribute cargo.
-
#contraband ⇒ Object
Returns the value of attribute contraband.
-
#current_credits ⇒ Object
Returns the value of attribute current_credits.
-
#current_system_name ⇒ Object
Returns the value of attribute current_system_name.
-
#economies ⇒ Object
Returns the value of attribute economies.
-
#governments ⇒ Object
Returns the value of attribute governments.
-
#market_data_filename ⇒ Object
Returns the value of attribute market_data_filename.
-
#save_file_path ⇒ Object
Returns the value of attribute save_file_path.
-
#systems ⇒ Object
Returns the value of attribute systems.
-
#trade_contraband ⇒ Object
Returns the value of attribute trade_contraband.
Instance Method Summary collapse
-
#encode_with(coder) ⇒ Object
Control which instance vars are emitted when dumped to YAML.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
121 122 123 |
# File 'lib/oolite.rb', line 121 def initialize reset end |
Instance Attribute Details
#cargo ⇒ Object
Returns the value of attribute cargo.
113 114 115 |
# File 'lib/oolite.rb', line 113 def cargo @cargo end |
#contraband ⇒ Object
Returns the value of attribute contraband.
115 116 117 |
# File 'lib/oolite.rb', line 115 def contraband @contraband end |
#current_credits ⇒ Object
Returns the value of attribute current_credits.
112 113 114 |
# File 'lib/oolite.rb', line 112 def current_credits @current_credits end |
#current_system_name ⇒ Object
Returns the value of attribute current_system_name.
111 112 113 |
# File 'lib/oolite.rb', line 111 def current_system_name @current_system_name end |
#economies ⇒ Object
Returns the value of attribute economies.
116 117 118 |
# File 'lib/oolite.rb', line 116 def economies @economies end |
#governments ⇒ Object
Returns the value of attribute governments.
117 118 119 |
# File 'lib/oolite.rb', line 117 def governments @governments end |
#market_data_filename ⇒ Object
Returns the value of attribute market_data_filename.
110 111 112 |
# File 'lib/oolite.rb', line 110 def market_data_filename @market_data_filename end |
#save_file_path ⇒ Object
Returns the value of attribute save_file_path.
109 110 111 |
# File 'lib/oolite.rb', line 109 def save_file_path @save_file_path end |
#systems ⇒ Object
Returns the value of attribute systems.
118 119 120 |
# File 'lib/oolite.rb', line 118 def systems @systems end |
#trade_contraband ⇒ Object
Returns the value of attribute trade_contraband.
114 115 116 |
# File 'lib/oolite.rb', line 114 def trade_contraband @trade_contraband end |
Instance Method Details
#encode_with(coder) ⇒ Object
Control which instance vars are emitted when dumped to YAML.
Example - not used at this time.
172 173 174 175 176 177 178 179 180 |
# File 'lib/oolite.rb', line 172 def encode_with(coder) vars = instance_variables.map { |x| x.to_s } vars = vars - ["@dummy"] vars.each do |var| var_val = eval(var) coder[var.gsub('@', '')] = var_val end end |
#reset ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/oolite.rb', line 125 def reset @save_file_path = '' @market_data_filename = 'oolite.market' @current_system_name = '' @current_credits = 0 @cargo = 0 @trade_contraband = false @contraband = [ "Slaves", "Narcotics", "Firearms", ] @economies = [ "Average Agricultural", "Average Industrial", "Mainly Agricultural", "Mainly Industrial", "Poor Agricultural", "Poor Industrial", "Rich Agricultural", "Rich Industrial", ] @governments = [ "Anarchy", "Communist", "Confederacy", "Corporate State", "Democracy", "Dictatorship", "Feudal", "Multi-Government", ] @systems = Hash.new end |