Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 233
    • Issues 233
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus GamesSolarus Games
  • solarussolarus
  • Merge requests
  • !1360

Addition of getters and setters (for Chests, Enemies, Doors, Jumpers, Blocks, Switches, Destructibles)

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open TwilCynder requested to merge TwilCynder/solarus:getters_update into dev Dec 17, 2020
  • Overview 20
  • Commits 16
  • Pipelines 11
  • Changes 9

Added some of the accessors listed in #1455. As stated in this issue, the final goal is to have access to every single property set when creating an entity. However, for this MR i only included the ones that seemed the most useful / relevant. This includes:

  • chest:get/set_opening_method() : returns or sets the opening method of this chest.
  • chest:get/set_opening_condition() : returns or set the item or savegame variable required to open this chest.
  • chest:is/set_opening_condition_consumed() : returns or sets whether the opening condition is consumed on opening.
  • All of the above for doors.
  • enemy:get_savegame_variable() : returns the savegame variable indicating whether this enemy is dead or not (or "" if this enemy is not saved) (simply returns the savegame_variable attribute)
  • door:get_savegame_variable() : returns the savegame variable that contains the state of this door (or "" if this door is not saved) (simply returns the savegame_variable attribute)
  • jumper:get_jump_length() : returns the jump length of this jumper. (simply returns the jump_length attribute)
  • block:get_direction() : if this block can only be pulled/push to a specific direction, returns it, if it can be moved in any direction returns -1. (simply returns the direction attribute)
  • switch:get_inactivate_when_leaving() : returns true is this switch is inactivated when the hero/block leaves it, or false if it's not. (simply returns the inactivate_when_leaving attribute) [was originally is_inactivate_when_leaving]
  • destructible:get_weight() : returns the weight of this destructible.

Also added the corresponding setter in some cases (when it seemingly didn't risk breaking something):

  • jumper:set_jump_length(length)
  • switch:set_inactivate_when_leaving(state) (defaults to true)
  • destructible:set_weight()

The corresponding MR in the doc repo will come soon.

Edited Apr 09, 2022 by TwilCynder
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: getters_update