Ejemplo n.º 1
0
bool
cIpmiMcVendor::CreateRdrs( cIpmiDomain *domain, cIpmiMc *source_mc, cIpmiSdrs *sdrs )
{
  if ( CreateResources( domain, source_mc, sdrs ) == false )
       return false;

  if ( CreateSensors( domain, source_mc, sdrs ) == false )
       return false;

  if ( CreateControls( domain, source_mc, sdrs ) == false )
       return false;

  if ( CreateSels( domain, source_mc, sdrs ) == false )
       return false;

  if ( CreateInvs( domain, source_mc, sdrs ) == false )
       return false;

  return true;
}
Ejemplo n.º 2
0
//-----------------------------------constructor-------------------------
//
//-----------------------------------------------------------------------
CMinesweeper::CMinesweeper():
                             m_dRotation(RandFloat() * CParams::dTwoPi),
                             m_lTrack(0),
                             m_rTrack(0),
                             m_dFitness(0),
							               m_dScale(CParams::iSweeperScale),
                             m_bCollided(false)
                             
			 
{
  //create a static start position
  m_vPosition = SVector2D(180, 200);

   //create the sensors
  CreateSensors(m_Sensors, CParams::iNumSensors, CParams::dSensorRange); 

  //initialize its memory
  m_MemoryMap.Init(CParams::WindowWidth,
                   CParams::WindowHeight);

}
Ejemplo n.º 3
0
//-----------------------------------constructor-------------------------
//
//-----------------------------------------------------------------------
CMinesweeper::CMinesweeper():
m_dRotation(0),
	m_lTrack(0),
	//m_rTrack(0),
	m_dFitness(0),
	m_dScale(CParams::iSweeperScale),
	m_bCollided(false)


{
	m_Color = CreatePen(PS_SOLID, 1, RGB(rand() % 205 + 50, rand() % 205 + 50, rand() % 205 + 50));
	//create a static start position
	m_vPosition = SVector2D(180, 50);

	//create the sensors
	CreateSensors(m_Sensors, CParams::iNumSensors, CParams::dSensorRange); 

	//initialize its memory
	m_MemoryMap.Init(CParams::WindowWidth,
		CParams::WindowHeight);

}
Ejemplo n.º 4
0
void MainScene::onEnter()
{
   CCScene::onEnter();
   // Create physical world
   CreatePhysics();
   
   // Add a color background.  This will make it easier on the eyes.
   addChild(SunBackgroundLayer::create());
   
   // Adding the debug lines so that we can draw the path followed.
   DebugLinesLayer* linesLayer = DebugLinesLayer::create();
   assert(linesLayer != NULL);
   addChild(DebugLinesLayer::create());
   linesLayer->setTag(TAG_DEBUG_LINES);
   addChild(linesLayer);
   
   // Grid
   // This should be at the bottom of the layer stack.
   GridLayer* gridLayer = GridLayer::create(5);
   assert(gridLayer != NULL);
   gridLayer->setTag(TAG_DEBUG_GRID);
   addChild(gridLayer);
   
   // Box2d Debug
   Box2DDebugDrawLayer* debugLayer = Box2DDebugDrawLayer::create(_world);
   assert(debugLayer != NULL);
   debugLayer->setTag(TAG_DEBUG_BOX2D);
   addChild(debugLayer);
   
   // Asteroids
   _asteroidLayer = SpriteBatchLayer::create("Asteroids_ImgData.png", "Asteroids_ImgData.plist");
   assert(_asteroidLayer != NULL);
   addChild(_asteroidLayer);
   
   // Space Ships
   _shipLayer = SpriteBatchLayer::create("EntitySpriteImages.png", "EntitySpriteImages.plist");
   assert(_shipLayer != NULL);
   addChild(_shipLayer);
   
   
   // Touch Input
   addChild(TapDragPinchInput::create(this));
   
   // User Controls
   addChild(PlayerGameControlsLayer::create());
   
   
   // Create the Anchor
   CreateAnchor();
   
   // Asteroids
   CreateAsteroids();
   
   // Populate physical world
   CreateEntity();
   
   // Create the sensor grid
   CreateSensors();
   
   // Contact Counts
   //   addChild(GraphSensorContactLayer::create());
   
   // Register for events
   Notifier::Instance().Attach(this, NE_VIEWPORT_CHANGED);
   Notifier::Instance().Attach(this, NE_GAME_COMMAND_ZOOM_IN);
   Notifier::Instance().Attach(this, NE_GAME_COMMAND_ZOOM_OUT);
   Notifier::Instance().Attach(this, NE_GAME_COMMAND_TRACK);
   
   // Kickstart all sizes
   ViewportChanged();
}