1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2019 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// 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
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.objectlib.main;
|
11
|
|
12
|
import android.content.res.Resources;
|
13
|
|
14
|
import java.io.IOException;
|
15
|
import java.io.InputStream;
|
16
|
|
17
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
18
|
|
19
|
public class InitAssets
|
20
|
{
|
21
|
private final InputStream mJsonStream;
|
22
|
private final InputStream mMeshStream;
|
23
|
private final Resources mRes;
|
24
|
|
25
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
26
|
|
27
|
public InitAssets(InputStream jsonStream, InputStream meshStream, Resources res)
|
28
|
{
|
29
|
mJsonStream = jsonStream;
|
30
|
mMeshStream = meshStream;
|
31
|
mRes = res;
|
32
|
}
|
33
|
|
34
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
35
|
|
36
|
public boolean noJsonStream()
|
37
|
{
|
38
|
return mJsonStream==null;
|
39
|
}
|
40
|
|
41
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
42
|
|
43
|
public InputStream getJsonStream()
|
44
|
{
|
45
|
return mJsonStream;
|
46
|
}
|
47
|
|
48
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
49
|
|
50
|
public InputStream getMeshStream()
|
51
|
{
|
52
|
return mMeshStream;
|
53
|
}
|
54
|
|
55
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56
|
|
57
|
public Resources getResources()
|
58
|
{
|
59
|
return mRes;
|
60
|
}
|
61
|
|
62
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
63
|
|
64
|
public void close()
|
65
|
{
|
66
|
try
|
67
|
{
|
68
|
if( mJsonStream!=null ) mJsonStream.close();
|
69
|
if( mMeshStream!=null ) mMeshStream.close();
|
70
|
}
|
71
|
catch(IOException ignored) {}
|
72
|
}
|
73
|
}
|