Project

General

Profile

« Previous | Next » 

Revision e9e744f7

Added by Leszek Koltunski over 1 year ago

Changes to the initialization - initialize the 'bought objects'

View differences:

src/main/java/org/distorted/purchase/PurchaseScreenPane.java
27 27

  
28 28
public class PurchaseScreenPane
29 29
{
30
  private static final int UNLOCK_ALL_PRICE = 1000;
31

  
30 32
  private static final int[] IMAGES =
31 33
    {
32 34
    R.drawable.difficulty1,
......
43 45
  private RubikObject mObject;
44 46

  
45 47
///////////////////////////////////////////////////////////////////////////////////////////////////
46
// TODO
48
// TODO: charge the user an amount of stars
47 49

  
48
  private boolean buyOne(String shortName)
50
  private boolean chargeUser(RubikObject object)
49 51
    {
50 52
    return true;
51 53
    }
52 54

  
53 55
///////////////////////////////////////////////////////////////////////////////////////////////////
54
// TODO
56
// TODO: charge the user an amount of stars
55 57

  
56
  private boolean buyAll()
58
  private boolean chargeUser()
57 59
    {
58 60
    return true;
59 61
    }
......
64 66
    {
65 67
    if( mObject!=null )
66 68
      {
67
      String shortName = mObject.getUpperName();
68

  
69
      if( !RubikObjectList.objectAlreadyBought(shortName) && buyOne(shortName) )
69
      if( !RubikObjectList.objectAlreadyBought(mObject) && chargeUser(mObject) )
70 70
        {
71
        android.util.Log.e("D", "buying "+shortName);
72

  
73
        RubikObjectList.buyObject(shortName);
71
        android.util.Log.e("D", "buying "+mObject.getUpperName());
72
        RubikObjectList.buyObject(mObject);
74 73
        }
75 74
      }
76 75
    }
......
79 78

  
80 79
  private void allButtonClicked()
81 80
    {
82
    if( !RubikObjectList.allAlreadyBought() && buyAll() )
81
    if( !RubikObjectList.allAlreadyBought() && chargeUser() )
83 82
      {
84 83
      RubikObjectList.buyAll();
85 84
      }

Also available in: Unified diff