Sha256: 21ef542f88156ef2c2883e2a01ef5be226c18a3059b907276eddcfb19d8b9380

Contents?: true

Size: 551 Bytes

Versions: 6

Compression:

Stored size: 551 Bytes

Contents

module GameMachine
  module Commands
    module MessageHelper
      def entity(id)
        MessageLib::Entity.new.set_id(id)
      end

      def entity_with_player(id,player_id)
        entity(id).set_player(MessageLib::Player.new.set_id(player_id))
      end

      def set_player(entity,player_id)
        entity.set_player(MessageLib::Player.new.set_id(player_id))
      end

      def is_component?(obj)
        obj.respond_to?(:message_name)
      end

      def is_entity?(obj)
        obj.is_a?(MessageLib::Entity)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
game_machine-1.0.4 lib/game_machine/commands/message_helper.rb
game_machine-1.0.2 lib/game_machine/commands/message_helper.rb
game_machine-0.0.11 lib/game_machine/commands/message_helper.rb
game_machine-0.0.10 lib/game_machine/commands/message_helper.rb
game_machine-0.0.9 lib/game_machine/commands/message_helper.rb
game_machine-0.0.8 lib/game_machine/commands/message_helper.rb