Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / main / InitAssets.java @ 224c0ff1

1 cf93ea4e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 3103c3c8 Leszek Koltunski
import org.distorted.objectlib.helpers.OperatingSystemInterface;
13 c0266cb1 Leszek Koltunski
14 19c8e760 Leszek Koltunski
import java.io.IOException;
15 cf93ea4e Leszek Koltunski
import java.io.InputStream;
16
17 19c8e760 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
18
19 cf93ea4e Leszek Koltunski
public class InitAssets
20
  {
21 c0266cb1 Leszek Koltunski
  private final InputStream mJsonStream;
22
  private final InputStream mMeshStream;
23 3103c3c8 Leszek Koltunski
  private final OperatingSystemInterface mInterface;
24 cf93ea4e Leszek Koltunski
25
///////////////////////////////////////////////////////////////////////////////////////////////////
26
27 3103c3c8 Leszek Koltunski
  public InitAssets(InputStream jsonStream, InputStream meshStream, OperatingSystemInterface inter)
28 cf93ea4e Leszek Koltunski
    {
29
    mJsonStream = jsonStream;
30
    mMeshStream = meshStream;
31 3103c3c8 Leszek Koltunski
    mInterface  = inter;
32 cf93ea4e Leszek Koltunski
    }
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 19c8e760 Leszek Koltunski
55 c0266cb1 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57 3103c3c8 Leszek Koltunski
  public OperatingSystemInterface getOS()
58 c0266cb1 Leszek Koltunski
    {
59 3103c3c8 Leszek Koltunski
    return mInterface;
60 c0266cb1 Leszek Koltunski
    }
61
62 19c8e760 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 cf93ea4e Leszek Koltunski
}