RGSS ਸਕ੍ਰਿਪਟਾਂ ਵਿੱਚ @ ਕੀ ਹੈ?

RGSS ਵਿੱਚ ਸਕ੍ਰਿਪਟਾਂ ਦੇ @ ਸੰਟੈਕਸ ਦਾ ਵਰਣਨ

ਇੱਕ ਕਲਾਸ ਲਈ ਇੱਕ ਉਦਾਹਰਨ ਵੇਰੀਏਬਲ ਨੂੰ ਪਰਿਭਾਸ਼ਿਤ ਕਰਦਾ ਹੈ। ਇਸ ਕਿਸਮ ਦੇ ਵੇਰੀਏਬਲ ਪੜ੍ਹਨ ਅਤੇ ਲਿਖਣ ਦੇ ਯੋਗ ਹੋਣ ਲਈ ਤੁਹਾਨੂੰ ਉਹਨਾਂ ਲਈ ਐਕਸੈਸਰ ਵਿਧੀਆਂ ਬਣਾਉਣ ਦੀ ਵੀ ਲੋੜ ਹੈ। ਤੁਸੀਂ ਸੰਬੰਧਿਤ ਆਪਰੇਟਰਾਂ ਨੂੰ ਆਪਣੇ ਆਪ ਲੋਡ ਕਰਨ ਲਈ attr_reader, attr_writer, ਜਾਂ attr_accessor ਸ਼ੌਰਟਕੋਡ ਦੀ ਵਰਤੋਂ ਵੀ ਕਰ ਸਕਦੇ ਹੋ।

ਕੋਡ ਉਦਾਹਰਨ:

def initialize
  @battler_name = ""
  @battler_hue = 0
  @hp = 0
  @sp = 0
  @states = []
  @states_turn = {}
  @maxhp_plus = 0
  @maxsp_plus = 0
  @str_plus = 0
  @dex_plus = 0
  @agi_plus = 0
  @int_plus = 0
  @hidden = false
  @immortal = false
  @damage_pop = false
  @damage = nil
  @critical = false
  @animation_id = 0
  @animation_hit = false
  @white_flush = false
  @blink = false
  @current_action = Game_BattleAction.new
end
ਬੰਦ ਕਰੋ ਮੋਬਾਈਲ ਵਰਜ਼ਨ