Skip to content
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

Open
wants to merge 2 commits into
base: practice-day3
Choose a base branch
from

Conversation

aldo-leon
Copy link

🙂 @Apostat23 @hivanreyes @Rikard189

Output:
Screen Shot 2022-01-12 at 10 10 42

Environment module added
Game class added
environment.rb Outdated
end

class Control
mission_status = [:paused, :aborted, :failed, :accomplished]
Copy link
Collaborator

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 ={
Copy link
Collaborator

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
      }

Copy link
Collaborator

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
Copy link
Collaborator

@Apostat23 Apostat23 Jan 13, 2022

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
Copy link
Collaborator

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]
Copy link
Collaborator

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.

Copy link
Collaborator

@Apostat23 Apostat23 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants