Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.

Dependencies:   25LCxxx_SPI CommonTypes Gameduino mbed

PlayerName.cpp

Committer:
RichardE
Date:
2013-06-17
Revision:
18:70190f956a24
Parent:
0:5fa232ee5fdf

File content as of revision 18:70190f956a24:

/*
 * SOURCE FILE : PlayerName.cpp
 *
 * Definition of class PlayerName.
 * Contains the name that appears in a high score table for example.
 *
 */

#include "PlayerName.h"

/***************/
/* CONSTRUCTOR */
/***************/
PlayerName::PlayerName() {
  // Initialise name to all 'X' characters.
  for( UInt8 i = 0; i < Length; ++i ) {
    Name[ i ] = 'X';
  }
  Name[ Length ] = (char)0;
}

/**************/
/* DESTRUCTOR */
/**************/
PlayerName::~PlayerName() {
}

/************************************************************/
/* COPY ONE NAME TO ANOTHER WITHOUT CREATING A NEW INSTANCE */
/************************************************************/
// Pass pointer to name to copy to in dest.
void PlayerName::CopyTo( PlayerName *dest ) const {
  for( UInt8 i = 0; i < Length; ++i ) {
    dest->Name[ i ] = Name[ i ];
  }
  dest->Name[ Length ] = (char)0;
}