1 |
9df01f21
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2020 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Distorted. //
|
5 |
|
|
// //
|
6 |
|
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Distorted is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
|
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.examples.predeform;
|
21 |
|
|
|
22 |
|
|
import org.distorted.library.effect.Effect;
|
23 |
|
|
|
24 |
|
|
import java.util.ArrayList;
|
25 |
|
|
|
26 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
27 |
|
|
|
28 |
|
|
public class PredeformEffectList
|
29 |
|
|
{
|
30 |
|
|
private static ArrayList<Effect> mList = new ArrayList<>();
|
31 |
|
|
|
32 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
33 |
|
|
|
34 |
|
|
static void addNew(Effect effect)
|
35 |
|
|
{
|
36 |
|
|
mList.add(effect);
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
40 |
|
|
|
41 |
|
|
static void removeAll()
|
42 |
|
|
{
|
43 |
|
|
mList.clear();
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
47 |
|
|
|
48 |
|
|
static void remove(long id)
|
49 |
|
|
{
|
50 |
|
|
int size = mList.size();
|
51 |
|
|
Effect effect;
|
52 |
|
|
|
53 |
|
|
for (int i=0; i<size; i++)
|
54 |
|
|
{
|
55 |
|
|
effect = mList.get(i);
|
56 |
|
|
|
57 |
|
|
if (effect.getID() == id )
|
58 |
|
|
{
|
59 |
|
|
mList.remove(i);
|
60 |
|
|
break;
|
61 |
|
|
}
|
62 |
|
|
}
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66 |
|
|
|
67 |
|
|
static ArrayList<Effect> getEffectList()
|
68 |
|
|
{
|
69 |
|
|
return mList;
|
70 |
|
|
}
|
71 |
|
|
}
|