Building name is optional

This commit is contained in:
2019-10-13 09:40:41 +03:00
parent d3fe2ff23b
commit a13969ce43
3 changed files with 6 additions and 5 deletions

View File

@ -50,8 +50,8 @@ module Game
def initialize(
@type : Type,
@name : String,
*,
name : String = "",
roles : Array(Role) | Nil = nil,
construction : Construction | Nil = nil,
production : Production | Nil = nil,
@ -59,6 +59,7 @@ module Game
restoration : Mining | Nil = nil,
storage : Capacity | Nil = nil
)
@name = name != "" ? name : @type.to_s
@roles = roles.nil? ? Array(Role).new : roles
@construction = construction.nil? ? Construction.immediatly : construction.as(Construction)
@production = production