More or less standardised separator comments in the code

This commit is contained in:
Maruno17
2024-06-27 21:21:26 +01:00
parent 225549bfce
commit 509a414f37
198 changed files with 1907 additions and 1263 deletions

View File

@@ -1,8 +1,10 @@
#===============================================================================
# The SaveData module is used to manipulate save data. It contains the {Value}s
# that make up the save data and {Conversion}s for resolving incompatibilities
# between Essentials and game versions.
# @see SaveData.register
# @see SaveData.register_conversion
#===============================================================================
module SaveData
# Contains the file path of the save file.
FILE_PATH = if File.directory?(System.data_directory)

View File

@@ -1,15 +1,21 @@
#===============================================================================
#
#===============================================================================
module SaveData
# Contains Value objects for each save element.
# Populated during runtime by SaveData.register calls.
# @type [Array<Value>]
@values = []
#=============================================================================
# An error raised if an invalid save value is being saved or loaded.
#=============================================================================
class InvalidValueError < RuntimeError; end
#=============================================================================
# Represents a single value in save data.
# New values are added using {SaveData.register}.
#=============================================================================
class Value
# @return [Symbol] the value id
attr_reader :id
@@ -160,7 +166,8 @@ module SaveData
# @!endgroup
end
#=============================================================================
#---------------------------------------------------------------------------
# Registers a {Value} to be saved into save data.
# Takes a block which defines the value's saving ({Value#save_value})
# and loading ({Value#load_value}) procedures.

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module SaveData
# Contains Conversion objects for each defined conversion:
# {
@@ -21,6 +24,7 @@ module SaveData
#=============================================================================
# Represents a conversion made to save data.
# New conversions are added using {SaveData.register_conversion}.
#=============================================================================
class Conversion
# @return [Symbol] conversion ID
attr_reader :id
@@ -134,7 +138,8 @@ module SaveData
# @!endgroup
end
#=============================================================================
#---------------------------------------------------------------------------
# Registers a {Conversion} to occur for save data that meets the given criteria.
# Two types of criteria can be defined: {Conversion#essentials_version} and
# {Conversion#game_version}. The conversion is automatically run on save data

View File

@@ -1,4 +1,6 @@
#===============================================================================
# Contains the save values defined in Essentials by default.
#===============================================================================
SaveData.register(:player) do
ensure_class :Player