BKICK Team Null (Python version)
Public Member Functions | Public Attributes | List of all members
CommBlock.CommBlock Class Reference

Base class for all communication blocks. More...

Inheritance diagram for CommBlock.CommBlock:
CommBlock.CommBlockAuthenticate CommBlock.CommBlockSetupMatch CommBlock.CommBlockTurnEnd CommBlock.CommBlockTurnKick CommBlock.CommBlockTurnMove CommBlock.CommBlockTurnStart CommBlock.CommBlockWaitForPartner

Public Member Functions

def __init__ (self, connection, verbose)
 Basic constructor for a communication block. More...
 
def HandleBlockEnd (self, blockName, msg)
 Check if a block has ended properly, otherwise display error and exit. More...
 
def HandleEndBlockError (self, blockName)
 Routine to handle errors which may be returned by the server at the end of a block. More...
 
def ReadAndCheck (self, expectedMessage)
 Read a messsage from the server and check whether it conforms with the expected message. More...
 

Public Attributes

 connection
 
 verbose
 

Detailed Description

Base class for all communication blocks.

Usually does not need to be modified

Constructor & Destructor Documentation

◆ __init__()

def CommBlock.CommBlock.__init__ (   self,
  connection,
  verbose 
)

Basic constructor for a communication block.

Parameters
connectionConnection object
verboseWhether to use verbose protocol version

Member Function Documentation

◆ HandleBlockEnd()

def CommBlock.CommBlock.HandleBlockEnd (   self,
  blockName,
  msg 
)

Check if a block has ended properly, otherwise display error and exit.

Parameters
blockNameThe name of the block, needed in case of error
msgThe message received from the server, determines whether the end was ok or not

◆ HandleEndBlockError()

def CommBlock.CommBlock.HandleEndBlockError (   self,
  blockName 
)

Routine to handle errors which may be returned by the server at the end of a block.

Parameters
blockNameName of the communication block where the error occured.

For details related to the communication blocks and the meaning of the errors, see the web documentation of the communication protocol.

Reads error message from server and terminates the connection as well as the client program.

◆ ReadAndCheck()

def CommBlock.CommBlock.ReadAndCheck (   self,
  expectedMessage 
)

Read a messsage from the server and check whether it conforms with the expected message.

Parameters
expectedMessageIf the received message does not equal expectedMessage, an error occured

The documentation for this class was generated from the following file: