示例#1
0
文件: AIMove.cs 项目: QRayarch/Maze
    // 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;
    }
示例#2
0
        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];
        }
示例#3
0
 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());
 }
示例#4
0
 public static byte[] Encrypt(this bool[] boolArray, int keyIndex = 0)
 {
     return(QEncryption.EncryptString(boolArray.ToString(StringDelimiter), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)));
 }
示例#5
0
 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));
 }
示例#6
0
 public static byte[] Encrypt(this List <int> intList, int keyIndex = 0)
 {
     return(QEncryption.EncryptString(intList.ToString(StringDelimiter), KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)));
 }
示例#7
0
 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));
 }
示例#8
0
 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());
 }
示例#9
0
 public static string DecryptString(this byte[] byteArray, int keyIndex = 0)
 {
     return(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)));
 }
示例#10
0
 public static byte[] Encrypt(this string value, int keyIndex = 0)
 {
     return(QEncryption.EncryptString(value, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex)));
 }
示例#11
0
 public static bool DecryptBool(this byte[] byteArray, int keyIndex = 0)
 {
     return(bool.Parse(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))));
 }
示例#12
0
 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))));
 }
示例#13
0
 public static int DecryptInt(this byte[] byteArray, int keyIndex = 0)
 {
     return(int.Parse(QEncryption.DecryptBytes(byteArray, KeyHolder.GetKey(keyIndex), KeyHolder.GetIV(keyIndex))));
 }