Class: Beefdump::Client::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/beefdump/client/base.rb

Overview

The most basic client which is kind of a client specification

Direct Known Subclasses

Graphical::Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game, player = nil) ⇒ Base

Initialize the client on connection to the server



8
9
10
11
# File 'lib/beefdump/client/base.rb', line 8

def initialize(game, player = nil)
  @game = game
  @player = player
end

Instance Attribute Details

#playerObject (readonly)

Returns the value of attribute player.



5
6
7
# File 'lib/beefdump/client/base.rb', line 5

def player
  @player
end

Instance Method Details

#actObject

Do whatever the client would like to do. This is called by the server in any game loop.



15
16
# File 'lib/beefdump/client/base.rb', line 15

def act
end

#disconnectObject

The server wants to close the connection to the client. Clean up the stuff in here



20
21
# File 'lib/beefdump/client/base.rb', line 20

def disconnect
end