-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aldo-leon--practice3 #21
base: practice-day3
Are you sure you want to change the base?
Conversation
Environment module added Game class added
environment.rb
Outdated
end | ||
|
||
class Control | ||
mission_status = [:paused, :aborted, :failed, :accomplished] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %i syntaxis. %i[paused aborted failed accomplished]
environment.rb
Outdated
class Worker < Human | ||
attr_accessor :standard_shift, :extra_shift | ||
def set_shift | ||
@standard_shift ={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to do this
@standard_shift = {
id: self.object_id,
hours: 8,
payment: 8,
facility: String.new,
status: nil
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...or this:
@standard_shift = { id: self.object_id, hours: 8, payment: 8, facility: '', status: nil }
attr_accessor :missions | ||
def initialize | ||
@missions = {} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use an empty line among method definitions would be great.
game.rb
Outdated
|
||
def new_mission(name: nil, objective: nil, pack: nil) | ||
@control.new_mission(name: name, objective: objective, pack: pack) | ||
@board[:control][:missions] = @control.missions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation should be only two spaces.
name = :alpha; objective = 'Get Alpha to the base'; pack = :simple_transportation_pack | ||
game.new_mission name: name, objective: objective, pack: game.depot.packs[pack] | ||
puts game.control.missions[:alpha] | ||
game.control.set_mission_to_accomplished(:alpha) and puts game.control.missions[:alpha] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use an extra empty line at the bottom of the file is taken as a good practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job Aldo! Please have a look to the little stuff that would be nice to change.
🙂 @Apostat23 @hivanreyes @Rikard189
Output: