Ejemplo n.º 1
0
Ball::Ball(const char* filename, int maxFrame, int frameDelay, int frameWidth,
           int frameHeight, int animationColumns, int animationDirection )
            : GameObject(filename, maxFrame, frameDelay, frameWidth, frameHeight, animationColumns, animationDirection), has_effect(-1), stand_on_platform(false)
{
    //setting ID and calling superclass constructor
    SetID(BALL);
}
Ejemplo n.º 2
0
void CControlUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
    if( _tcscmp(pstrName, _T("id")) == 0 ) SetID(_ttoi(pstrValue));
	else if(_tcscmp(pstrName,_T("font")) == 0)  SetFont(_ttoi(pstrValue));
	else if(_tcscmp(pstrName, _T("name")) == 0) SetName(pstrValue);
    else if( _tcscmp(pstrName, _T("width")) == 0 ) SetFixedWidth(_ttoi(pstrValue));
    else if( _tcscmp(pstrName, _T("height")) == 0 ) SetFixedHeight(_ttoi(pstrValue));
    else if( _tcscmp(pstrName, _T("minwidth")) == 0 ) SetMinWidth(_ttoi(pstrValue));
    else if( _tcscmp(pstrName, _T("minheight")) == 0 ) SetMinHeight(_ttoi(pstrValue));
    else if( _tcscmp(pstrName, _T("maxwidth")) == 0 ) SetMaxWidth(_ttoi(pstrValue));
    else if( _tcscmp(pstrName, _T("maxheight")) == 0 ) SetMaxHeight(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, _T("inset")) == 0) {
		RECT rcInset = { 0 };
		LPTSTR pstr = NULL;
		rcInset.left = _tcstol(pstrValue, &pstr, 10);
		rcInset.top = _tcstol(pstr + 1, &pstr, 10); 
		rcInset.right = _tcstol(pstr + 1, &pstr, 10);
		rcInset.bottom = _tcstol(pstr + 1, &pstr, 10);
		SetInset(rcInset);
	}
	else if(_tcscmp(pstrName, _T("visible")) == 0){
		bool bVisible = _tcscmp(pstrValue, _T("true"))==0;
		SetVisible(bVisible);
	}
	else if(_tcscmp(pstrName, _T("display")) == 0) SetDisplayed(_tcscmp(pstrValue, _T("true"))==0);
	else{
#ifdef _DEBUG
		MessageBox(NULL, pstrValue, pstrName, MB_ICONEXCLAMATION);
#endif
	}
}
Ejemplo n.º 3
0
void Tractor::Init(ALLEGRO_BITMAP *image)
{
	GameObject::Init(100, 100, 1, 1, 0, 0, 50, 50);

	SetID(TRACTOR);
	SetAlive(true);

	money = 50000;
	health = 2;
	fuel = 60;

	move = false;
	wasBlocked = false;
	action = false;

	frameWidth = 50;
	frameHeight = 50;
	
	for (int i = 0; i < 2; i++)
	{
		for (int j = 0; j < 5; j++)
			Supply[i][j] = 0;
	}

	Supply[2][0] = 11;
	Supply[2][1] = 13;
	Supply[2][2] = 15;
	Supply[2][3] = 14;
	Supply[2][4] = 14;

	if (image != NULL)
		Tractor::image = image;
	ResetPodpowiedz();
}
Ejemplo n.º 4
0
	Agent::Agent(NavMesh* mesh, int id)
	{
		m_AgentID = -1;
		m_NavMesh = mesh;
		m_Moving = false;
		SetID(id);
	}
Ejemplo n.º 5
0
void C_Mission::Setup(long ID,short Type)
{
	SetID(ID);
	SetType(Type);
	SetDefaultFlags();
	SetReady(1);

	TakeOff_=new O_Output;
	TakeOff_->SetOwner(this);
	TakeOff_->SetFont(Font_);
	TakeOff_->SetTextWidth(10);
	Mission_=new O_Output;
	Mission_->SetOwner(this);
	Mission_->SetFont(Font_);
	Package_=new O_Output;
	Package_->SetOwner(this);
	Package_->SetFont(Font_);
	Package_->SetTextWidth(6);
	Status_=new O_Output;
	Status_->SetOwner(this);
	Status_->SetFont(Font_);
	Priority_=new O_Output;
	Priority_->SetOwner(this);
	Priority_->SetFont(Font_);
	Priority_->SetTextWidth(4);
}
void
ReleaseDataRPC::operator()(int id_)
{
    SetID(id_);

    Execute();
}
Ejemplo n.º 7
0
 FetchAccountUID::FetchAccountUID (__int64 iID, __int64 iAccountID, const String &sUID, const String &sDate) :
    account_id_(iAccountID),
    uid_(sUID),
    date_(sDate)
 {
    SetID(iID);
 }
Ejemplo n.º 8
0
Salvage::Salvage(const CargoHolder &source)
:	CargoHolder(source),
	TurnCreated(TheGame->GetTurn()),
	MaxSize(0)
{
	SetID(TheGalaxy->GetSalvageID());
}
Ejemplo n.º 9
0
void VersionInfo::InitRowHead()
{
	SetID("\n[APPLICATION]");

	if ( isImpFile )
	{
		CString strArray[2];
		strArray[0] = _T("AppName=");
		strArray[1] = _T("Version=");
		for(int i=0;i<m_RowArray.GetSize();i++)
		{
			ASSERT(m_RowArray.GetSize()==2);
			m_RowArray.GetAt(i)->InitHead(strArray[i]);
		}
	} 
	else
	{
		CString strArray[5];
		strArray[0] = _T("AppName=");
		strArray[1] = _T("Version=");
		strArray[2] = _T("CST Use=");
		strArray[3] = _T("GSC Use=");
		strArray[4] = _T("XTS Use=");
		for(int i=0;i<m_RowArray.GetSize();i++)
		{
			ASSERT(m_RowArray.GetSize()==5);
			m_RowArray.GetAt(i)->InitHead(strArray[i]);
		}
	}
	
}
Ejemplo n.º 10
0
UISelectItem::UISelectItem(Context* context, const String &str, const String &id, const String &skinImage) : Object(context)
    , subSource_(0)
{
    SetID(id);
    SetString(str);
    SetSkinImage(skinImage);
}
Ejemplo n.º 11
0
Asteroid::Asteroid(int x, int y, SDL_Surface *sprite, Player *p) {
	GameObject();

	m_posX = x;
	m_posY = y;

	m_velX = 1;
	m_velY = 0;

	m_dirX = -1;
	m_dirY = 0;

	m_boundX = 35;
	m_boundY = 35;

	m_curFrame = 0;
	m_frameWidth = 64;
	m_frameHeight = 64;

	m_frameCount = 0;
	m_frameDelay = 3;

	m_maxFrame = 64;
	m_animationColumns = 8;
	m_animationRow = 0;
	m_animationDirection = 1;

	SetSprite(sprite);
	SetID(ENEMY);
	Asteroid::p=p;
}
Ejemplo n.º 12
0
bool
IConXtor::AddToSceneAndLockID(void)
{
	if(!_idLocked)
		return LockID(SetID(SCENE->Add(this->Connection())));
	return _idLocked;
}
Ejemplo n.º 13
0
//------------------------------ ctor -----------------------------------------
//-----------------------------------------------------------------------------
BaseGameEntity::BaseGameEntity(int ID):m_dBoundingRadius(0.1),
                                       m_vScale(Vector2D(1.0,1.0)),
                                       m_iType(default_entity_type),
                                       m_bTag(false)
{
  SetID(ID);
}
Ejemplo n.º 14
0
/*******************************************************************************
* Function Name  : OTGD_FS_CoreInit
* Description    : Initialize the USB_OTG controller registers and prepares the core
                   for device mode or host mode operation.
* Input          : None
* Output         : None
* Return         : Status
*******************************************************************************/
USB_OTG_Status OTGD_FS_CoreInit(void)
{
  USB_OTG_Status status = USB_OTG_OK;
  USB_OTG_usb_cfg_data usbcfg;

  usbcfg.d32 = 0;

  /* Reset the Controller */
  OTGD_FS_CoreReset();

  usbcfg.d32 = READ_REG32(&core_regs.common_regs->usb_cfg);
  usbcfg.b.physel = 1;
  WRITE_REG32 (&core_regs.common_regs->usb_cfg, usbcfg.d32);

  /* init and configure the phy */
  OTGD_FS_PhyInit();

  /* Reset after a PHY select and set Host mode */
  OTGD_FS_CoreReset();

  /* Set Host or Device Mode */
  SetID();

  return status;
}
Ejemplo n.º 15
0
bool CItem::Ship_Plank( bool fOpen )
{
	// IT_SHIP_PLANK to IT_SHIP_SIDE and IT_SHIP_SIDE_LOCKED
	// This item is the ships plank.

	CItemBase * pItemDef = Item_GetDef();
	ITEMID_TYPE idState = (ITEMID_TYPE) RES_GET_INDEX( pItemDef->m_ttShipPlank.m_idState );
	if ( ! idState )
	{
		// Broken ?
		return( false );
	}
	if ( IsType(IT_SHIP_PLANK))
	{
		if ( fOpen )
			return( true );
	}
	else
	{
		DEBUG_CHECK( IsType(IT_SHIP_SIDE) || IsType(IT_SHIP_SIDE_LOCKED));
		if ( ! fOpen )
			return( true );
	}

	SetID( idState );
	Update();
	return( true );
}
Ejemplo n.º 16
0
void C_Tile::Setup(long ID,short Type,long ImageID)
{
	SetID(ID);
	SetType(Type);
	SetDefaultFlags();
	SetImage(ImageID);
}
Ejemplo n.º 17
0
void C_Fill::Setup(long ID,short Type)
{
	SetID(ID);
	SetType(Type);
	SetDefaultFlags();
	SetReady(1);
}
Ejemplo n.º 18
0
void C_Anim::Setup(long ID,short Type,long AnimID)
{
	SetID(ID);
	SetType(Type);
	SetDefaultFlags();
	SetAnim(AnimID);
}
Ejemplo n.º 19
0
obj_Treadmill_Left::obj_Treadmill_Left(void)
{
	/*   EASTEREGG
	 *     .-"-.
	 *   .'=^=^='.
	 *  /=^=^=^=^=\
	 * :^= HAPPY =^;
	 * |^ EASTER! ^|
	 * :^=^=^=^=^=^:
	 *  \=^=^=^=^=/
	 *   `.=^=^=.'
	 *     `~~~`
	 */
	SetID(TREADMILL_LEFT);
	
	boundUp = 0;
	boundDown = 32;
	boundLeft = 0;
	boundRight = 32;

	image = ImageManager::GetInstance().GetImage(ImageManager::IMG_TREADMILL);

	frameCount = 0;
	currentFrame = 0;
}
Ejemplo n.º 20
0
Platform::Platform(const char* filename, int maxFrame, int frameDelay, int frameWidth,
           int frameHeight, int animationColumns, int animationDirection )
            : GameObject(filename, maxFrame, frameDelay, frameWidth, frameHeight, animationColumns, animationDirection), has_effect(-1)
{
    //setting ID to PLAYER and calling superclass constructor
    SetID(PLAYER);
}
Ejemplo n.º 21
0
void C_Custom::Setup(long ID,short Type,short NumCtrls)
{
	short i;

	SetID(ID);
	SetType(Type);
	SetDefaultFlags();

	if(Count_)
		return;

	SetReady(0);

	if(NumCtrls > 0 && NumCtrls < _CUSTOM_MAX_CTRLS_)
	{
		Count_=NumCtrls;
		Items_=new O_Output[Count_];
#ifdef USE_SH_POOLS
		ItemValues_=(long*)MemAllocPtr(UI_Pools[UI_GENERAL_POOL],sizeof(long)*(Count_),FALSE);
#else
		ItemValues_=new long[Count_];
#endif

		for(i=0;i<Count_;i++)
		{
			Items_[i].SetOwner(this);
			ItemValues_[i]=0;
		}
		SetReady(1);
	}
}
Ejemplo n.º 22
0
void cMoneyDivideBox::CreateDivideBox( LONG x, LONG y, LONG ID, cbDivideFUNC cbFc1, cbDivideFUNC cbFc2, void * vData1, void* vData2, char* strTitle )
{
	m_cbDivideFunc = cbFc1;
	m_cbCancelFunc = cbFc2;
	m_vData1 = vData1;
	m_vData2 = vData2;
	SetAbsXY(x,y);
	SetID(ID);

	m_pOKBtn = (cButton *)GetWindowForID(CMI_MONEYDIVIDEOK);
	m_pCancelBtn = (cButton *)GetWindowForID(CMI_MONEYDIVIDECANCEL);

	m_pSpin = (cSpin *)GetWindowForID(CMI_MONEYDIVIDESPIN);
	m_pSpin->SetValidCheck(VCM_NUMBER); // 숫자만 입력 되도록 한다.
	m_pSpin->SetAlign( TXT_RIGHT );		// 오른정렬
	m_pSpin->SetFocusEdit( TRUE );
//	m_pSpin->SetUnit( 0 );

	// Title Text 입력 LBS 03.11.19 : 수정 KES
	if( strTitle )
	{
		cStatic* pStatic = new cStatic;
		
		// 070504 LYW --- 타이틀 위치 수정
		//pStatic->Init( 13, 2, 0, 0, NULL );
		pStatic->Init( 13, 10, 0, 0, NULL );
		pStatic->SetShadow( TRUE );
		pStatic->SetFontIdx( 2 );
		pStatic->SetAlign( TXT_LEFT );
		pStatic->SetStaticText( strTitle );
		
		Add( pStatic );
	}
}
Ejemplo n.º 23
0
WSound::WSound(WCore* const core, uint ID) : WBase(core) {
	m_valid = false;
	m_numBuffers = W_NUM_SOUND_BUFFERS_PER_SOUND;
	m_buffers = new ALuint[m_numBuffers];
	ZeroMemory(m_buffers, m_numBuffers * sizeof ALuint);

	// Generate Buffers
	alGetError(); // clear error code
	alGenBuffers(m_numBuffers, m_buffers);
	ALenum err = alGetError();

	// Generate Source
	alGetError(); //clear errors
	alGenSources(1, &m_source);

	//initiate the locals
	SetID(ID);

	char name[256];
	static uint i = 0;
	sprintf_s(name, 256, "Sound%3u", i++);
	SetName(name);

	GetCorePtr()->SoundComponent->m_RegisterSound(this);
}
Ejemplo n.º 24
0
void ControlBase::ReadProperties(tinyxml2::XMLElement* element)
{
	SetID(element->Attribute("id"));

	if (strcmp(element->Name(), "form") != 0) 
		_type = element->Attribute("type"); 
}
Ejemplo n.º 25
0
PG_ScrollBar::PG_ScrollBar(PG_Widget* parent, const PG_Rect& r, ScrollDirection direction, int id, const char* style) : 
	PG_Widget(parent, r) 
{
	sb_direction = direction;

	SetID(id);

	scroll_min = 0;
	scroll_max = 4;
	scroll_current = 0;

	my_linesize = 1;
	my_pagesize = 5;

	scrollbutton[0] = new PG_Button(this);
	scrollbutton[0]->SetID((direction == VERTICAL) ? IDSCROLLBAR_UP : IDSCROLLBAR_LEFT);
	scrollbutton[0]->sigClick.connect(slot(*this, &PG_ScrollBar::handleButtonClick));
	
	scrollbutton[1] = new PG_Button(this);
	scrollbutton[1]->SetID((direction == VERTICAL) ? IDSCROLLBAR_DOWN : IDSCROLLBAR_RIGHT);
	scrollbutton[1]->sigClick.connect(slot(*this, &PG_ScrollBar::handleButtonClick));

	dragbutton = new ScrollButton(this);
	dragbutton->SetID(IDSCROLLBAR_DRAG);
	dragbutton->sigClick.connect(slot(*this, &PG_ScrollBar::handleButtonClick));

/*	if(strcmp(style, "Scrollbar") != 0) {
		LoadThemeStyle("Scrollbar");
	}
	LoadThemeStyle(style);
*/	SetPosition(0);
}
Ejemplo n.º 26
0
void
ExportDatabaseRPC::operator()(const int id_, const ExportDBAttributes *atts)
{
    SetID(id_);
    SetExportDBAtts(atts);

    Execute();
}
Ejemplo n.º 27
0
Bullet::Bullet(float x, float y, void(*ScorePoint)(void))
{
	GameObject::Init(x, y, 10, 0, 1, 0, 0, 0);

	SetID(BULLET);

	Bullet::ScorePoint = ScorePoint;
}
Ejemplo n.º 28
0
CExplodingBullet::CExplodingBullet(void)
{
	SetID(OBJ_BULLET_EXP);
	m_fSpeed = 0.0f;
	m_fMaxRadius = 0.0f;
	SetRadius(0.0f);
	SetColor(D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));
}
Ejemplo n.º 29
0
IConXtor::IConXtor(void)
{
	_idLocked=false;
	SetID(EMPTY);
	connection = (IObjection<IConXtor>*)this;
	TypeHashCode=(unsigned)typeid(IConXtor).hash_code();
	ConnectionID = 0;
}
CObject::CObject()
{
	SetID(LEVEL);
	m_nRefCount = 0;
	m_cpMesh = nullptr;
	m_cpTexture = nullptr;
	m_cpBounds = nullptr;
	m_bColliding = false;
}