Skip to content

Should we use set and get functions? #30

Closed

Description

@Tymewalk

Take a look at code in the Sprite class:

def changeScaleBy(self, amount):
    '''Change the sprite's scale by (amount).'''
    self.scale += amount

def setScaleTo(self, scale):
    '''Set the sprite's scale to (amount).'''
    self.scale = scale

def getScale(self):
    '''Get the sprite's current scale.'''
    return self.scale

Should we use set and get functions?

Activity

  1. BookOwl commented on Mar 26, 2016

    @BookOwl
    Member

    Since we are not validating anything, I say that we get rid of them and just let the user directly manipulate the variables. If we decide that we need validation, we can always switch to properties.

  2. Tymewalk commented on Mar 28, 2016

    @Tymewalk
    MemberAuthor

    @BookOwl OK.
    Should we remove the changeBy functions, too? Or should we leave those in?

  3. BookOwl commented on Mar 28, 2016

    @BookOwl
    Member

    Yes

  4. Tymewalk commented on Mar 28, 2016

    @Tymewalk
    MemberAuthor

    @BookOwl OK. I'll get on it.

  5. Tymewalk commented on Mar 28, 2016

    @Tymewalk
    MemberAuthor

    Wait, we actually DO validate something - when the z-index is changed we reorder the sprites.
    That's the only thing though.

  6. BookOwl commented on Mar 28, 2016

    @BookOwl
    Member

    We can use properties to automatically reorder the sprites list when it gets changed. I'm on my way home from camping now, I can work on this either tonight or tomorrow. (I'm in the Eastern time zone)

  7. Tymewalk commented on Mar 28, 2016

    @Tymewalk
    MemberAuthor

    @BookOwl OK. Whenever is fine, I'll just make a separate branch so I can get started. 😄

  8. BookOwl commented on Mar 28, 2016

    @BookOwl
    Member

    Great!

  9. added a commit that references this issue on Mar 28, 2016
  10. Tymewalk commented on Mar 28, 2016

    @Tymewalk
    MemberAuthor

    Closing as this was only a question, we've reached an agreement.

    Discussion about the actual implementation should go in #34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions