示例#1
0
Unemployed::Unemployed( Camera& camera, PlayerCityPtr city)
  : Info( camera, city, 15 )
{
  _visibleWalkers() << walker::recruter;
  _initialize();
}
示例#2
0
bool MgCmdDrawDiamond::initialize(const MgMotion* sender, MgStorage*)
{
    return _initialize(MgShapeT<MgDiamond>::create, sender);
}
示例#3
0
文件: lexeme.cpp 项目: igelhaus/qubiq
Lexeme::Lexeme(const QString &name)
{
    _initialize(name, false);
}
示例#4
0
PhatScene::PhatScene() {
    _initialize();
}
示例#5
0
bool MgCmdDrawTriangle::initialize(const MgMotion* sender)
{
    return _initialize(MgShapeT<MgLines>::create, sender);
}
示例#6
0
	/**
	 *  @alsymbols
	 *  @alutfunref{Init}
	 *  @alutfunref{InitWithoutContext}
	 */
	ALUtilityToolkit(bool with_context, int argc, char** argv)
	 : _initialized(_initialize(with_context, argc, argv))
	{ }
示例#7
0
Crime::Crime( Camera& camera, PlayerCityPtr city)
  : Info( camera, city, 18 )
{
  _addWalkerType( walker::prefect );
  _initialize();
}
/**
 * Parses data from client. (Overloading from superclass)
 */
void ClientSonyDeckControlUDP::_parselineDispatch() {

  if (_serialOutput > 2) {
    Serial.print(F("INCOMING DATA: \n"));
    for (uint8_t i = 0; i < _bufferWriteIndex; i++) {
      if (_binarybuffer[i] < 16) {
        Serial.print(0);
      }
      Serial.print(_binarybuffer[i], HEX);
      Serial.print(':');
      if (i == 20) {
        Serial.print(' ');
      }
    }
    Serial.print(F(" Length="));
    Serial.println(_bufferWriteIndex);
  }

  unsigned int cmd = ((unsigned int)_binarybuffer[0] << 8) + (unsigned int)_binarybuffer[1];

  switch (cmd) {
  case 0x7920:
    // Both flags are set in one go:
    _hasInitialized = true;
    _initialize();

    if (_binarybufferCheckSum != _lastStatusCheckSum) { // Only update if new information (we use the checksum to determine that, since it depends entirely on the data transmitted)
      _lastStatusCheckSum = _binarybufferCheckSum;
      if (_serialOutput > 1)
        Serial.println(F("*** Updating states:"));

      // Playing:
      if (_isPlaying != ((_binarybuffer[3] & B00000001) > 0)) {
        _isPlaying = ((_binarybuffer[3] & B00000001) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isPlaying: "));
        if (_serialOutput > 1)
          Serial.println(isPlaying());
      }

      // Recording
      if (_isRecording != ((_binarybuffer[3] & B00000010) > 0)) {
        _isRecording = ((_binarybuffer[3] & B00000010) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isRecording: "));
        if (_serialOutput > 1)
          Serial.println(isRecording());
      }

      // Forwarding x2 or more:
      if (_isForwarding != ((_binarybuffer[3] & B00000100) > 0)) {
        _isForwarding = ((_binarybuffer[3] & B00000100) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isForwarding: "));
        if (_serialOutput > 1)
          Serial.println(isForwarding());
      }

      // Rewinding x1 or more:
      if (_isRewinding != ((_binarybuffer[3] & B00001000) > 0)) {
        _isRewinding = ((_binarybuffer[3] & B00001000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isRewinding: "));
        if (_serialOutput > 1)
          Serial.println(isRewinding());
      }

      // Stopped:
      if (_isStopped != ((_binarybuffer[3] & B00100000) > 0)) {
        _isStopped = ((_binarybuffer[3] & B00100000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isStopped: "));
        if (_serialOutput > 1)
          Serial.println(isStopped());
      }

      // Cassette Out:
      if (_isCassetteOut != ((_binarybuffer[2] & B00100000) > 0)) {
        _isCassetteOut = ((_binarybuffer[2] & B00100000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isCassetteOut: "));
        if (_serialOutput > 1)
          Serial.println(isCassetteOut());
      }

      // Local mode (If REM is not enabled):
      if (_isInLocalModeOnly != ((_binarybuffer[2] & B00000001) > 0)) {
        _isInLocalModeOnly = ((_binarybuffer[2] & B00000001) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isInLocalModeOnly: "));
        if (_serialOutput > 1)
          Serial.println(isInLocalModeOnly());
      }

      // Stand By:
      if (_isStandby != ((_binarybuffer[3] & B10000000) > 0)) {
        _isStandby = ((_binarybuffer[3] & B10000000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isStandby: "));
        if (_serialOutput > 1)
          Serial.println(isStandby());
      }

      // Jog Mode:
      if (_isInJogMode != ((_binarybuffer[4] & B00010000) > 0)) {
        _isInJogMode = ((_binarybuffer[4] & B00010000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isInJogMode: "));
        if (_serialOutput > 1)
          Serial.println(isInJogMode());
      }

      // Direction Backwards:
      if (_isDirectionBackwards != ((_binarybuffer[4] & B00000100) > 0)) {
        _isDirectionBackwards = ((_binarybuffer[4] & B00000100) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isDirectionBackwards: "));
        if (_serialOutput > 1)
          Serial.println(isDirectionBackwards());
      }

      // Still:
      if (_isStill != ((_binarybuffer[4] & B00000010) > 0)) {
        _isStill = ((_binarybuffer[4] & B00000010) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isStill: "));
        if (_serialOutput > 1)
          Serial.println(isStill());
      }

      // Near EOT:
      if (_isNearEOT != ((_binarybuffer[10] & B00100000) > 0)) {
        _isNearEOT = ((_binarybuffer[10] & B00100000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isNearEOT: "));
        if (_serialOutput > 1)
          Serial.println(isNearEOT());
      }

      // EOT:
      if (_isEOT != ((_binarybuffer[10] & B00010000) > 0)) {
        _isEOT = ((_binarybuffer[10] & B00010000) > 0);
        if (_serialOutput > 1)
          Serial.print(F("isEOT: "));
        if (_serialOutput > 1)
          Serial.println(isEOT());
      }
    }
    break;
  case 0x1001:
    if (_serialOutput > 1)
      Serial.println(F("ACK"));
    break;
  case 0x1112:
    if (_serialOutput > 1)
      Serial.println(F("NACK"));
    if (_serialOutput > 1)
      Serial.println(_binarybuffer[2]);
    break;
  default:
    if (_serialOutput) {
      if (_serialOutput > 1)
        Serial.println(F("Unsupported Data Packet:"));
      for (uint8_t i = 0; i < _binarybufferExpectedLength; i++) {
        Serial.println(_binarybuffer[i], HEX);
      }
      if (_serialOutput > 1)
        Serial.println(F("==="));
    }
    break;
  }
}
示例#9
0
Aborigens::Aborigens( Camera& camera, PlayerCityPtr city)
  : Info( camera, city, 15 )
{
  _visibleWalkers() << walker::indigene << walker::missioner;
  _initialize();
}
示例#10
0
static int INITIALIZE_GPIB(GtkWidget *initBUTTON, GTKwrapper* state)
{
  gpibHANDLE = _initialize(gpibADDR);
  setDefaults(gpibHANDLE);
}
示例#11
0
PhatPlane::PhatPlane(vec2f size) {
    _initialize(size);
}
示例#12
0
PhatPlane::PhatPlane() {
    _initialize(vec2f(100.0f, 100.0f));
}
示例#13
0
	/**
	 *  @alsymbols
	 *  @alutfunref{Init}
	 *  @alutfunref{InitWithoutContext}
	 */
	ALUtilityToolkit(bool with_context)
	 : _initialized(_initialize(with_context))
	{ }
示例#14
0
File::File(Dat::Entry* datFileEntry) : Dat::Item(datFileEntry)
{
    _initialize();
}
示例#15
0
void CSoundRender_TargetA::_restart()
{
	_destroy();
	_initialize();
}
示例#16
0
File::File(std::ifstream * stream) : Dat::Item(stream)
{
    _initialize();
}
示例#17
0
CardItem::CardItem(const Card *card) {
    _initialize();
    setCard(card);
    setAcceptHoverEvents(true);
}
示例#18
0
文件: World.cpp 项目: Aishiro/ATools
void CWorld::Create(int width, int height, int textureID, float heightMap, int MPU, bool indoor, const string& bitmap)
{
	m_width = width;
	m_height = height;
	m_MPU = MPU;
	m_inDoor = indoor;

	m_cameraPos = D3DXVECTOR3(MPU * -14, heightMap + MPU * 25, MPU * -14);
	m_cameraAngle.x = 45.0f;
	m_cameraAngle.y = -30.0f;

	_initialize();

	int x, i, y, x2, y2;
	CLandscape* land;
	for (y = 0; y < m_height; y++)
	{
		for (x = 0; x < m_width; x++)
		{
			land = m_lands[y * m_width + x] = new CLandscape(m_device, this, x * MAP_SIZE, y * MAP_SIZE);
			land->GetLayer(textureID);
		}
	}

	QImage image;
	if (!bitmap.isEmpty() && image.load(bitmap))
	{
		QTransform rot;
		rot.rotate(90);
		image = image.transformed(rot);
		for (y = 0; y < m_height; y++)
		{
			for (x = 0; x < m_width; x++)
			{
				land = m_lands[y * m_width + x];
				for (x2 = 0; x2 < (MAP_SIZE + 1); x2++)
				{
					for (y2 = 0; y2 < (MAP_SIZE + 1); y2++)
					{
						land->m_heightMap[x2 *(MAP_SIZE + 1) + y2] = QColor(image.pixel(
							(int)(((float)(x2 + y * MAP_SIZE) / (float)(m_height * MAP_SIZE)) * (float)image.width()),
							(int)(((float)(y2 + x * MAP_SIZE) / (float)(m_width * MAP_SIZE)) * (float)image.height())
							)).redF() * heightMap;
					}
				}
			}
		}
	}
	else
	{
		for (y = 0; y < m_height; y++)
		{
			for (x = 0; x < m_width; x++)
			{
				land = m_lands[y * m_width + x];
				for (i = 0; i < (MAP_SIZE + 1) * (MAP_SIZE + 1); i++)
					land->m_heightMap[i] = heightMap;
			}
		}
	}
}
示例#19
0
文件: lexeme.cpp 项目: igelhaus/qubiq
Lexeme::Lexeme(const QString &lexeme, bool is_boundary)
{
    _initialize(lexeme, is_boundary);
}
示例#20
0
bool MgCmdParallelogram::initialize(const MgMotion* sender)
{
    return _initialize(MgShapeT<MgParallelogram>::create, sender);
}
示例#21
0
	static bool _initialize(bool with_context)
	{
		char buf[2] = {'\0'};
		char* arg = buf;
		return _initialize(with_context, 1, &arg);
	}