Method: Town#set_function!

Defined in:
lib/lib/units/town.rb

#set_function!(func, commanding_faction) ⇒ Object

Set desired function and possibly also project



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/lib/units/town.rb', line 61

def set_function!(func, commanding_faction)
  super

  if @faction != 0 and commanding_faction == @faction and func == FUNCBUILD
    # Set starting project once or ask player about next project
    if @starting_project
       set_project!(@starting_project)
       @starting_project = nil
    else
      GameState.switch!(BuildState.instance)
      BuildState.instance.unit = self
    end
  end
end