VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
WaterParticleSet.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WATERPARTICLESET_H
18 #define WATERPARTICLESET_H
19 
20 #include <QSet>
21 #include "WaterParticle.h"
22 
32 public:
38 
42  int getParticleCount() const { return mParticles.count(); }
47  void addParticle(WaterParticle* particle);
53  WaterParticle* getParticleWithUserData(void* userData) const;
58  bool containsParticle(WaterParticle* particle) const;
63  void clearParticles();
67  void update();
68 
69 private:
70  QSet<WaterParticle*> mParticles;
71 };
72 
73 #endif // WATERPARTICLESET_H
WaterParticle * getParticleWithUserData(void *userData) const
Returns the WaterParticle associated with the given particle's user data, or nullptr if it does not c...
bool containsParticle(WaterParticle *particle) const
Returns whether or not the given WaterParticle exists in this set.
A collection of WaterParticles which can perform updates each frame.
Definition: WaterParticleSet.h:31
A Particle which destroys itself after a decay time has elapsed.
Definition: WaterParticle.h:26
int count() const
void update()
Calls WaterParticle::update() on all WaterParticles in this set.
int getParticleCount() const
Returns the number of WaterParticles in this set.
Definition: WaterParticleSet.h:42
void clearParticles()
Deletes all WaterParticles associated with this set, deleting the associated LiquidFun particles as w...
WaterParticleSet()
Construct an empty WaterParticleSet.
void addParticle(WaterParticle *particle)
Adds a WaterParticle to be tracked by this set.