2 * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "entityCreator.h"
22 #include "entityManager.h"
23 #include "Entities/Ball.h"
24 #include "graphics/colors.h"
26 /// ***** Private Variables *****
28 typedef std::queue<Ball*> queBall;
31 /// ***** Initializers/Cleaners *****
35 addBall(Vector2(50, 50), 20, cWhite);
36 addBall(Vector2(150, 50), 20, cGrey);
37 addBall(Vector2(50, 100), 20, cRed);
38 addBall(Vector2(100, 100), 20, cGreen);
39 addBall(Vector2(150, 100), 20, cBlue);
40 addBall(Vector2(50, 150), 20, cYellow);
41 addBall(Vector2(100, 150), 20, cMagenta);
42 addBall(Vector2(150, 150), 20, cCyan);
49 /// ***** Public Methods *****
51 void creator::addBall(const Vector2& pos, float radius, const float* color)
53 Ball* ball = new Ball(pos, radius, color);
58 void creator::removeBall()
60 Ball* ball = Balls.front();
66 void creator::removeAllBalls()
68 while(! Balls.empty() )
70 Ball* ball = Balls.front();
72 manager::remove(ball);