Project

General

Profile

Download (2.54 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / purchase / PurchaseObjectLibInterface.java @ 7f9c3cce

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 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.purchase;
11

    
12
import com.google.firebase.crashlytics.FirebaseCrashlytics;
13

    
14
import org.distorted.library.message.EffectMessageSender;
15
import org.distorted.objectlib.BuildConfig;
16
import org.distorted.objectlib.helpers.BlockController;
17
import org.distorted.objectlib.helpers.ObjectLibInterface;
18

    
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
public class PurchaseObjectLibInterface implements ObjectLibInterface
22
{
23
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
24
  public void onScrambleEffectFinished() { }
25
  public void onBeginRotation() { }
26
  public void onSolved() { }
27
  public void onObjectCreated(long time) { }
28
  public void onReplaceModeDown(int cubit, int face) { }
29
  public void onReplaceModeUp() { }
30
  public void onFinishRotation(int axis, int row, int angle) { }
31
  public void failedToDrag() { }
32
  public void reportJSONError(String error, int ordinal) { }
33
  public void reportBlockProblem(int type, int place, long pause, long resume, long time) { }
34

    
35
///////////////////////////////////////////////////////////////////////////////////////////////////
36

    
37
  public void reportProblem(String problem, boolean reportException)
38
    {
39
    if( BuildConfig.DEBUG )
40
      {
41
      android.util.Log.e("interface", problem);
42
      }
43
    else
44
      {
45
      if( reportException )
46
        {
47
        Exception ex = new Exception(problem);
48
        FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
49
        crashlytics.setCustomKey("problem" , problem);
50
        crashlytics.recordException(ex);
51
        }
52
      else
53
        {
54
        FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
55
        crashlytics.log(problem);
56
        }
57
      }
58
    }
59
}
(2-2/6)