Project

General

Profile

Download (2.95 KB) Statistics
| Branch: | Revision:

examples / src / main / java / org / distorted / examples / predeform / PredeformEffectList.java @ 641ea00c

1
///////////////////////////////////////////////////////////////////////////////////////////////////
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.VertexEffect;
23

    
24
import java.util.ArrayList;
25

    
26
///////////////////////////////////////////////////////////////////////////////////////////////////
27

    
28
public class PredeformEffectList
29
  {
30
  private static ArrayList<VertexEffect> mList = new ArrayList<>();
31

    
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33

    
34
  static void addNew(VertexEffect 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
    VertexEffect 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<VertexEffect> getEffectList()
68
    {
69
    return mList;
70
    }
71
  }
(4-4/7)