コード例 #1
0
ファイル: GridNode.cs プロジェクト: professorlust/CardNinjas
 void Update()
 {
     if (type != prevType)
     {
         hold += Time.deltaTime;
         if (hold > 6f)
         {
             type = prevType;
             if (type == Enums.FieldType.Red)
             {
                 GetComponent <Renderer>().material = red;
             }
             else if (type == Enums.FieldType.Blue)
             {
                 GetComponent <Renderer>().material = blue;
             }
             else if (type == Enums.FieldType.Destroyed)
             {
                 GetComponent <Renderer>().material = destroyed;
             }
             else
             {
                 GetComponent <Renderer>().material = white;
             }
             this.gameObject.tag = type.ToString();
         }
     }
 }
コード例 #2
0
ファイル: StressTests.cs プロジェクト: tranxuannam/bk_data
        private List <HrbcFieldCreator.FieldSpec> GenerateFields(Enums.FieldType fieldType, Enums.ResourceType resource, int count)
        {
            var fieldList = new List <HrbcFieldCreator.FieldSpec>();

            for (var i = 0; i < count; i++)
            {
                fieldList.Add(new HrbcFieldCreator.FieldSpec
                {
                    FieldType = fieldType,
                    Key       = $"id_{fieldType}_{resource}_{i}",
                    Label     = $"TestField_{i}",
                    Resource  = resource
                });
            }
            return(fieldList);
        }
コード例 #3
0
 public bool panelAllowed(Enums.Direction direction, Enums.FieldType type)
 {
     if (direction == Enums.Direction.Up)
     {
         return(Up != null && Up.type == type);
     }
     if (direction == Enums.Direction.Down)
     {
         return(Down != null && Down.type == type);
     }
     if (direction == Enums.Direction.Left)
     {
         return(Left != null && Left.type == type);
     }
     if (direction == Enums.Direction.Right)
     {
         return(Right != null && Right.type == type);
     }
     return(false);
 }
コード例 #4
0
        public bool panelAllowed(Enums.Direction direction, Enums.FieldType type)
        {
            //Perform a check to verify that an adjacent tile exists physically and has not
            //been destroyed by a player.

            if (direction == Enums.Direction.Up)
            {
                return((Up != null) && (Up.type == type) && (Up.type != Enums.FieldType.Destroyed));
            }
            if (direction == Enums.Direction.Down)
            {
                return((Down != null) && (Down.type == type) && (Down.type != Enums.FieldType.Destroyed));
            }
            if (direction == Enums.Direction.Left)
            {
                return((Left != null) && (Left.type == type) && (Left.type != Enums.FieldType.Destroyed));
            }
            if (direction == Enums.Direction.Right)
            {
                return((Right != null) && (Right.type == type) && (Right.type != Enums.FieldType.Destroyed));
            }
            return(false);
        }
コード例 #5
0
        /// <summary>
        /// Get a list of active Fields
        /// </summary>
        /// <param name="resourceType">Client/Contract/Recruiter...</param>
        /// <param name="fieldType">Client/Contract/Recruiter...</param>
        /// <returns>List of Alias</returns>
        public static List <string> GetActiveFieldList(Enums.ResourceType resourceType, Enums.FieldType fieldType)
        {
            List <string> result = new List <string>();

            //Dictionary<string, string> searchConditions = new Dictionary<string, string>()
            //{
            //    { "resource",resourceType.ToLowerString() },
            //    { "properties/s.type",((int)fieldType).ToString() },
            //    { "properties/s.deleted","0" },
            //};
            //List<string> fieldList = new List<string>()
            //{
            //    "alias","resource", "properties/*"
            //};
            //List<Resources.PrivateAPI.Field.Field> resultList = FieldAPI.SearchSuccess(fieldList, searchConditions);

            //if (resultList != null && resultList.Count > 0)
            //{
            //    foreach (Resources.PrivateAPI.Field.Field field in resultList)
            //    {
            //        result.Add(field.alias as string);
            //    }
            //}
            //else
            //{
            //    Log.Info("Cannot read Field!");
            //}
            return(result);
        }
コード例 #6
0
ファイル: GridNode.cs プロジェクト: JonathanHunter/CardNinjas
 void Update()
 {
     if(type != prevType)
     {
         hold += Time.deltaTime;
         if(hold > 6f)
         {
             type = prevType;
             if (type == Enums.FieldType.Red)
                 GetComponent<Renderer>().material = red;
             else if (type == Enums.FieldType.Blue)
                 GetComponent<Renderer>().material = blue;
             else if (type == Enums.FieldType.Destroyed)
                 GetComponent<Renderer>().material = destroyed;
             else
                 GetComponent<Renderer>().material = white;
             this.gameObject.tag = type.ToString();
         }
     }
 }
コード例 #7
0
 public TextBoxTypeExtension(Binding binding, Enums.FieldType type)
 {
     _binding                    = binding;
     _binding.Converter          = new NumberConverter();
     _binding.ConverterParameter = type;
 }