// Use this for initialization void Start() { base.Start(); pathFinder = GetComponent<PathFinder>(); pathFinder.Grid = grid; pathFinder.DistanceCanJump = heightCanJump; pathFinder.HeightCanJump = distanceCanJump; pathFinder.MaxDistance = maxSearchDistance; holder = GetComponent<KeyHolder>(); holder.OnKeyPickedUp += KeyPickedUp; trans = transform; }
public KeyRing(IKey defaultKey, IEnumerable<IKey> allKeys) { _keyIdToKeyHolderMap = new Dictionary<Guid, KeyHolder>(); foreach (IKey key in allKeys) { _keyIdToKeyHolderMap.Add(key.KeyId, new KeyHolder(key)); } // It's possible under some circumstances that the default key won't be part of 'allKeys', // such as if the key manager is forced to use the key it just generated even if such key // wasn't in the underlying repository. In this case, we just add it now. if (!_keyIdToKeyHolderMap.ContainsKey(defaultKey.KeyId)) { _keyIdToKeyHolderMap.Add(defaultKey.KeyId, new KeyHolder(defaultKey)); } DefaultKeyId = defaultKey.KeyId; _defaultKeyHolder = _keyIdToKeyHolderMap[DefaultKeyId]; }
public static List <int> DecryptIntList(this byte[] byteArray, int keyIndex = 0) { return(Array.ConvertAll(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)).Split(StringDelimiter), int.Parse).ToList()); }
public static byte[] Encrypt(this bool[] boolArray, int keyIndex = 0) { return(QEncryption.EncryptString(boolArray.ToString(StringDelimiter), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))); }
public static int[] DecryptIntArray(this string value, int keyIndex = 0) { return(Array.ConvertAll(QEncryption.DecryptBytes(Array.ConvertAll(value.Split(StringDelimiter), byte.Parse), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)).Split(StringDelimiter), int.Parse)); }
public static byte[] Encrypt(this List <int> intList, int keyIndex = 0) { return(QEncryption.EncryptString(intList.ToString(StringDelimiter), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))); }
public static float[] DecryptFloatArray(this byte[] byteArray, int keyIndex = 0) { return(Array.ConvertAll(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)).Split(StringDelimiter), float.Parse)); }
public static List <float> DecryptFloatList(this string value, int keyIndex = 0) { return(Array.ConvertAll(QEncryption.DecryptBytes(Array.ConvertAll(value.Split(StringDelimiter), byte.Parse), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)).Split(StringDelimiter), float.Parse).ToList()); }
public static string DecryptString(this byte[] byteArray, int keyIndex = 0) { return(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))); }
public static byte[] Encrypt(this string value, int keyIndex = 0) { return(QEncryption.EncryptString(value, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))); }
public static bool DecryptBool(this byte[] byteArray, int keyIndex = 0) { return(bool.Parse(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)))); }
public static bool DecryptBool(this string value, int keyIndex = 0) { return(bool.Parse(QEncryption.DecryptBytes(Array.ConvertAll(value.Split(StringDelimiter), byte.Parse), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)))); }
public static int DecryptInt(this byte[] byteArray, int keyIndex = 0) { return(int.Parse(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)))); }