Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Задача Майхилла о стрелках / Examples / VC60 / Стрелки Майхилла / Riflemans / FClasses / Shot / Bullet
.cpp// Bullet.cpp: implementation of the CBullet class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "..\fair.h"
#include "Bullet.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBullet::CBullet(CWnd* pW, int nNum, CSize sz, LArc *pTBL)
:TBounce(pW, nNum, sz, pTBL)
{
pFsaShot = NULL;
}
CBullet::CBullet():TBounce() { pFsaShot = NULL; }
CBullet::~CBullet() { }
void CBullet::SetAddrMan(LFsaAppl * pFsaAppl) { pFsaShot = pFsaAppl; }
//
LArc BulletTBL[] = {
LArc("st","b1", "x1x3", "y4"),
LArc("st","b1", "^x3", "y4"),
LArc("b1","b1", "^x2", "y1"),
LArc("b1","st", "x2x3", "y4"),
LArc("b1","00", "x2^x3","--"),
LArc()
};
int CBullet::x1()
{
if (!pFsaShot) return false;
return string((pFsaShot)->FGetState()) == "выстрел";
}
int CBullet::x2()
{
return m_ptCenter.y + m_sizeRadius.cy >= rcClient.bottom;
}
int CBullet::x3()
{
return nNumBounce;
}
void CBullet::y4() { SetCenter(0,10); }
void CBullet::SetCenter(int x, int y)
{
if (y) m_ptCenter.y = y;
if (x) m_ptCenter.x = x;
}
void CBullet::SetMove(int cx, int cy)
{
m_sizeMove.cx = cx;
m_sizeMove.cy = cy;
}
Соседние файлы в папке Shot