PulpCore

pulpcore.util.crypt
Class EncryptedInt

java.lang.Object
  extended by pulpcore.animation.Property
      extended by pulpcore.animation.Int
          extended by pulpcore.util.crypt.EncryptedInt
All Implemented Interfaces:
PropertyListener

public class EncryptedInt
extends Int
implements PropertyListener

An EncryptedInt is an Int whose value is internally encrypted. This class is usefull for protecting against runtime memory modifications from tools like Cheat Engine. For a game with global high scores, typical encrypted values might be the score and the game level.


Constructor Summary
EncryptedInt()
          Constructs a new Int object with no listener, the value of zero, and a cipher with a randomly generated encryption key.
EncryptedInt(ARC4 cipher)
          Constructs a new Int object with no listener, the value of zero, and the specified cipher.
EncryptedInt(int value)
          Constructs a new Int object with the specified value, no listener, and a cipher with a randomly generated encryption key.
EncryptedInt(int value, ARC4 cipher)
          Constructs a new Int object with the specified value, no listener, and the specified cipher.
EncryptedInt(PropertyListener listener)
          Constructs a new Int object with the specified listener, the value of zero, and a cipher with a randomly generated encryption key.
EncryptedInt(PropertyListener listener, ARC4 cipher)
          Constructs a new Int object with the specified listener, the value of zero, and the specified cipher.
EncryptedInt(PropertyListener listener, int value)
          Constructs a new Int object with the specified value, the specified listener, and a cipher with a randomly generated encryption key.
EncryptedInt(PropertyListener listener, int value, ARC4 cipher)
          Constructs a new Int object with the specified value, the specified listener, and the specified cipher.
 
Method Summary
 boolean equals(Object obj)
          Returns true if the specified object is an Int, Fixed, Byte, Short, Integer, Long, Float, or Double, and its value is equal to this value.
 int get()
           
 int hashCode()
           
 void propertyChange(Property property)
          Notifies that a property's value has changed.
 
Methods inherited from class pulpcore.animation.Int
animate, animate, animate, animateTo, animateTo, animateTo, bindTo, bindTo, bindTo, bindWithInverse, bindWithInverse, set, set, setValue, toString
 
Methods inherited from class pulpcore.animation.Property
addListener, getBehavior, getListeners, getValue, isAnimating, removeListener, setBehavior, setValue, stopAnimation, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptedInt

public EncryptedInt()
Constructs a new Int object with no listener, the value of zero, and a cipher with a randomly generated encryption key.


EncryptedInt

public EncryptedInt(ARC4 cipher)
Constructs a new Int object with no listener, the value of zero, and the specified cipher.


EncryptedInt

public EncryptedInt(PropertyListener listener)
Constructs a new Int object with the specified listener, the value of zero, and a cipher with a randomly generated encryption key.


EncryptedInt

public EncryptedInt(PropertyListener listener,
                    ARC4 cipher)
Constructs a new Int object with the specified listener, the value of zero, and the specified cipher.


EncryptedInt

public EncryptedInt(int value)
Constructs a new Int object with the specified value, no listener, and a cipher with a randomly generated encryption key.


EncryptedInt

public EncryptedInt(int value,
                    ARC4 cipher)
Constructs a new Int object with the specified value, no listener, and the specified cipher.


EncryptedInt

public EncryptedInt(PropertyListener listener,
                    int value)
Constructs a new Int object with the specified value, the specified listener, and a cipher with a randomly generated encryption key.


EncryptedInt

public EncryptedInt(PropertyListener listener,
                    int value,
                    ARC4 cipher)
Constructs a new Int object with the specified value, the specified listener, and the specified cipher.

Method Detail

propertyChange

public void propertyChange(Property property)
Description copied from interface: PropertyListener
Notifies that a property's value has changed.

Specified by:
propertyChange in interface PropertyListener
Parameters:
property - the property whose value has changed.

get

public int get()
Overrides:
get in class Int

equals

public boolean equals(Object obj)
Description copied from class: Int
Returns true if the specified object is an Int, Fixed, Byte, Short, Integer, Long, Float, or Double, and its value is equal to this value.

Overrides:
equals in class Int

hashCode

public int hashCode()
Overrides:
hashCode in class Int

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.