Esempio n. 1
0
	Copy* User::Buy(Book* book)
	{
		RoleManage::Valid(this, Role::Guest);
		if (book->Price() > money) throw OperationFail("You have no enough money");
		Copy* re = Core::BookMng->books.FetchCopy(book);
		if (!re) throw OperationFail("Can't buy the book, books has already sell out.");
		Core::BookMng->books.Remove(re);
		AddCopy(re);
		money -= book->Price();
		return re;
	}
Esempio n. 2
0
/**--------------------------------------------------------------------------<BR>
C2DLineBaseSet::MakeCopy
\brief Makes a copy of the other set.
<P>---------------------------------------------------------------------------*/
void C2DLineBaseSet::MakeCopy( const C2DLineBaseSet& Other)
{
	DeleteAll();
	AddCopy(Other);

}
Esempio n. 3
0
	void User::Add(Book* book, int cnt)
	{
		RoleManage::Valid(this, Role::Admin);
		for (int i = 0; i < cnt; ++i)
			AddCopy(&Copy(book));
	}
Esempio n. 4
0
/**--------------------------------------------------------------------------<BR>
C2DPolygonSet::MakeCopy
\brief Makes a copy of the set provided.
<P>---------------------------------------------------------------------------*/
void C2DPolygonSet::MakeCopy( const C2DPolygonSet& Other)
{
	DeleteAll( );
	AddCopy(Other);

}