mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Module#deprecated_method_alias (#101)
* Add Module#deprecated_method_alias * Use deprecated_method_alias in 010_Pokemon_Deprecated.rb * Use deprecated_method_alias on the rest of Pokemon methods Also, use deprecate_constant on MAX_POKEMON_NAME_SIZE * Use deprecated_method_alias on PlayerTrainer methods * Ensure aliased method exists in deprecated_method_alias
This commit is contained in:
@@ -96,6 +96,7 @@ end
|
||||
class Pokemon
|
||||
# @deprecated Use {MAX_NAME_SIZE} instead. This alias is slated to be removed in v20.
|
||||
MAX_POKEMON_NAME_SIZE = MAX_NAME_SIZE
|
||||
deprecate_constant :MAX_POKEMON_NAME_SIZE
|
||||
|
||||
# @deprecated Use {Owner#public_id} instead. This alias is slated to be removed in v20.
|
||||
def publicID
|
||||
@@ -151,12 +152,6 @@ class Pokemon
|
||||
@owner.language = value
|
||||
end
|
||||
|
||||
# @deprecated Use {Pokemon#gender=} instead. This alias is slated to be removed in v20.
|
||||
def setGender(value)
|
||||
Deprecation.warn_method('Pokemon#setGender', 'v20', 'Pokemon#gender=')
|
||||
self.gender = value
|
||||
end
|
||||
|
||||
# @deprecated Use {Pokemon#shiny=} instead. This alias is slated to be removed in v20.
|
||||
def makeShiny
|
||||
Deprecation.warn_method('Pokemon#makeShiny', 'v20', 'Pokemon#shiny=true')
|
||||
@@ -169,33 +164,20 @@ class Pokemon
|
||||
self.shiny = false
|
||||
end
|
||||
|
||||
# @deprecated Use {Pokemon#ability_index=} instead. This alias is slated to be removed in v20.
|
||||
def setAbility(value)
|
||||
Deprecation.warn_method('Pokemon#setAbility', 'v20', 'Pokemon#ability_index=')
|
||||
self.ability_index = value
|
||||
end
|
||||
deprecated_method_alias :setGender, :gender=, removal_in: 'v20'
|
||||
deprecated_method_alias :setAbility, :ability_index=, removal_in: 'v20'
|
||||
deprecated_method_alias :setNature, :nature=, removal_in: 'v20'
|
||||
deprecated_method_alias :setItem, :item=, removal_in: 'v20'
|
||||
|
||||
# @deprecated Use {Pokemon#nature=} instead. This alias is slated to be removed in v20.
|
||||
def setNature(value)
|
||||
Deprecation.warn_method('Pokemon#setNature', 'v20', 'Pokemon#nature=')
|
||||
self.nature = value
|
||||
end
|
||||
|
||||
# @deprecated Use {Pokemon#item=} instead. This alias is slated to be removed in v20.
|
||||
def setItem(value)
|
||||
Deprecation.warn_method('Pokemon#setItem', 'v20', 'Pokemon#item=')
|
||||
self.item = value
|
||||
end
|
||||
|
||||
alias healStatus heal_status
|
||||
alias pbLearnMove learn_move
|
||||
alias pbDeleteMove forget_move
|
||||
alias pbDeleteMoveAtIndex forget_move_at_index
|
||||
alias pbRecordFirstMoves record_first_moves
|
||||
alias pbAddFirstMove add_first_move
|
||||
alias pbRemoveFirstMove remove_first_move
|
||||
alias pbClearFirstMoves clear_first_moves
|
||||
alias pbUpdateShadowMoves update_shadow_moves
|
||||
deprecated_method_alias :healStatus, :heal_status, removal_in: 'v20'
|
||||
deprecated_method_alias :pbLearnMove, :learn_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbDeleteMove, :forget_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbDeleteMoveAtIndex, :forget_move_at_index, removal_in: 'v20'
|
||||
deprecated_method_alias :pbRecordFirstMoves, :record_first_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbAddFirstMove, :add_first_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbRemoveFirstMove, :remove_first_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbClearFirstMoves, :clear_first_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbUpdateShadowMoves, :update_shadow_moves, removal_in: 'v20'
|
||||
end
|
||||
|
||||
# (see Pokemon#initialize)
|
||||
|
||||
Reference in New Issue
Block a user