1 |
e342c3f7
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2022 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
babb7b08
|
Leszek Koltunski
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7 |
|
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8 |
e342c3f7
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9 |
|
|
|
10 |
|
|
package org.distorted.objectlib.scrambling;
|
11 |
|
|
|
12 |
|
|
import java.util.TreeSet;
|
13 |
|
|
|
14 |
|
|
import org.distorted.objectlib.helpers.ObjectSignature;
|
15 |
|
|
|
16 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
17 |
|
|
|
18 |
|
|
public class BlacklistedSignatures
|
19 |
|
|
{
|
20 |
|
|
private static BlacklistedSignatures mThis;
|
21 |
|
|
private final TreeSet<ObjectSignature> mBlacklisted;
|
22 |
|
|
|
23 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
24 |
|
|
|
25 |
|
|
private BlacklistedSignatures()
|
26 |
|
|
{
|
27 |
|
|
mBlacklisted = new TreeSet<>();
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
31 |
|
|
|
32 |
|
|
public static BlacklistedSignatures getInstance()
|
33 |
|
|
{
|
34 |
|
|
if( mThis==null ) mThis = new BlacklistedSignatures();
|
35 |
|
|
return mThis;
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
39 |
|
|
|
40 |
|
|
public void clear()
|
41 |
|
|
{
|
42 |
|
|
mBlacklisted.clear();
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
46 |
|
|
|
47 |
|
|
public void add(ObjectSignature signature)
|
48 |
|
|
{
|
49 |
|
|
mBlacklisted.add(signature);
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
53 |
|
|
|
54 |
|
|
public boolean contains(ObjectSignature signature)
|
55 |
|
|
{
|
56 |
|
|
return mBlacklisted.contains(signature);
|
57 |
|
|
}
|
58 |
|
|
}
|