Permalink
Browse files

Added some code comments.

  • Loading branch information...
1 parent 3de3878 commit 999b3b09003bbe6c6542473d0da12fd7499b851e @mcantelon committed Mar 2, 2014
View
4 engine/class/character.class.rb
@@ -1,3 +1,7 @@
+#
+# The Character class represents a non-player character.
+#
+
class Character < GameComponent
include Uses_Weapons
View
6 engine/class/command.class.rb
@@ -1,3 +1,7 @@
+#
+# The Command class represents a game command.
+#
+
class Command
include Handles_YAML_Files
@@ -7,9 +11,7 @@ class Command
def initialize(params)
@id = params[:id]
-
@game = params[:game]
-
@image_stack = params[:image_stack]
@output_stack = params[:output_stack]
View
4 engine/class/door.class.rb
@@ -1,3 +1,7 @@
+#
+# The Door class represents a conditionally available location exit.
+#
+
class Door < GameComponent
include Has_Events
View
4 engine/class/game.class.rb
@@ -1,3 +1,7 @@
+#
+# The Game class represents the game as a whole.
+#
+
class Game
attr_accessor :state, :helpers, :app_base_path, :path, :config, :player, :characters, :locations, :doors, :props, :turns, :over, :transitions
View
5 engine/class/game_component.class.rb
@@ -1,3 +1,8 @@
+#
+# The GameComponent class is used as a base class for other classes that
+# represent elements in a game.
+#
+
class GameComponent
include Referred_To_Using_English
View
4 engine/class/location.class.rb
@@ -1,3 +1,7 @@
+#
+# The Location class represents a location in a game.
+#
+
class Location
attr_accessor :id, :path, :loaded, :name, :description, :dark, :exits,
View
4 engine/class/player.class.rb
@@ -1,3 +1,7 @@
+#
+# The Player class represents a game player.
+#
+
class Player
include Uses_Weapons
View
4 engine/class/prop.class.rb
@@ -1,3 +1,7 @@
+#
+# The Prop class represents an item in the game.
+#
+
class Prop < GameComponent
include Has_Events
View
5 engine/module/handles_scoring.rb
@@ -1,3 +1,8 @@
+#
+# The Handles_Scoring module handles adding to the player's score and
+# reporting scoring.
+#
+
module Handles_Scoring
include Handles_YAML_Files
View
5 engine/module/handles_yaml_files.module.rb
@@ -1,3 +1,8 @@
+#
+# The Handles_YAML_Files module handles the loading and saving of data from
+# and to YAML and recursiv discover of YAML files.
+#
+
module Handles_YAML_Files
def load_yaml_file(file_path)
View
5 engine/module/has_events.rb
@@ -1,3 +1,8 @@
+#
+# The Has_Events module handles event responses. A random response will
+# be selected and executed, if it's logic, or returned as a string, if not.
+#
+
module Has_Events
def event(type)
View
4 engine/module/has_traits.rb
@@ -1,3 +1,7 @@
+#
+# The Has_Traits module adds a way to get/set trait data.
+#
+
module Has_Traits
attr_accessor :traits
View
5 engine/module/parses_commands.module.rb
@@ -1,3 +1,8 @@
+#
+# The Parses_Commands module handles the parsing of an input string, breaking
+# it into lexemes and seeing if it matches the syntax of a command.
+#
+
module Parses_Commands
include Handles_YAML_Files
View
5 engine/module/referred_to_using_english.rb
@@ -1,3 +1,8 @@
+#
+# The Referred_To_Using_English module support a number of English language
+# contexts in which a noun can be used.
+#
+
module Referred_To_Using_English
attr_accessor :name, :proper, :plural
View
6 engine/module/uses_weapons.module.rb
@@ -1,3 +1,9 @@
+#
+# The Uses_Weapons module allows combat-related properties to be set
+# and provides a method that return the best weapons that an entity
+# possesses.
+#
+
module Uses_Weapons
attr_accessor :id, :hp, :strength, :dead, :default_attack

0 comments on commit 999b3b0

Please sign in to comment.