Example #1
0
        public override int GetHashCode()
        {
            int hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this

            hashCode = hashCode * 23 + Id.GetHashCode();
            hashCode = hashCode * 23 + (Fid == null ? 0 : Fid.GetHashCode());
            hashCode = hashCode * 23 + (EnableDate == null ? 0 : EnableDate.GetHashCode());
            hashCode = hashCode * 23 + (DisableDate == null ? 0 : DisableDate.GetHashCode());
            hashCode = hashCode * 23 + Dr.GetHashCode();
            hashCode = hashCode * 23 + Ts.GetHashCode();
            hashCode = hashCode * 23 + (CreateBy == null ? 0 : CreateBy.GetHashCode());
            hashCode = hashCode * 23 + (CreateDate == null ? 0 : CreateDate.GetHashCode());
            hashCode = hashCode * 23 + (CreateName == null ? 0 : CreateName.GetHashCode());
            hashCode = hashCode * 23 + (UpdateBy == null ? 0 : UpdateBy.GetHashCode());
            hashCode = hashCode * 23 + (UpdateDate == null ? 0 : UpdateDate.GetHashCode());
            hashCode = hashCode * 23 + (UpdateName == null ? 0 : UpdateName.GetHashCode());
            hashCode = hashCode * 23 + (TableName == null ? 0 : TableName.GetHashCode());
            hashCode = hashCode * 23 + (TableComment == null ? 0 : TableComment.GetHashCode());
            hashCode = hashCode * 23 + (TableMode == null ? 0 : TableMode.GetHashCode());
            hashCode = hashCode * 23 + (SubTable == null ? 0 : SubTable.GetHashCode());
            hashCode = hashCode * 23 + IsTree.GetHashCode();
            hashCode = hashCode * 23 + IsPagination.GetHashCode();
            hashCode = hashCode * 23 + IsSync.GetHashCode();

            return(hashCode);
        }
Example #2
0
        public void createFileListVarI固定なし()
        {
            var list = CreateName.createFileListVarI("test<連番i>", 100, false);

            Assert.AreEqual(list[0], "test1");
            Assert.AreEqual(list[99], "test100");
        }
Example #3
0
 public void fixCalTestテスト()
 {
     Assert.AreEqual(CreateName.fixCal(1), 1);
     Assert.AreEqual(CreateName.fixCal(9), 1);
     Assert.AreEqual(CreateName.fixCal(10), 2);
     Assert.AreEqual(CreateName.fixCal(99), 2);
     Assert.AreEqual(CreateName.fixCal(100), 3);
     Assert.AreEqual(CreateName.fixCal(999), 3);
 }
Example #4
0
 public override void Validate()
 {
     base.Validate();
     ScheduleId.HasValue("时间节点编码不能为空").MaxLength(50, "时间节点编码限制长度50");
     ScheduleName.HasValue("时间节点不能为空").MaxLength(50, "时间节点限制长度50");
     ProjectId.HasValue("项目编码不能为空").MaxLength(50, "项目编码限制长度50");
     Summary.HasValue("问题摘要不能为空").MaxLength(50, "问题摘要限制长度200");
     //Detail.HasValue("问题详情不能为空").MaxLength(50, "问题详情限制长度200");
     CreateName.HasValue("创建人不能为空").MaxLength(50, "创建人限制长度50");
     PrincipalId.HasValue("负责人编码不能为空").MaxLength(50, "负责人编码限制长度50");
     PrincipalName.HasValue("负责人不能为空").MaxLength(50, "负责人限制长度50");
 }
Example #5
0
    public static CharacterBase Create(int staticId, string name = null, int level = 1, Vector3 pos = default)
    {
        var  staticData = MainStaticDataCenter.instance.roleBaseTable.findItemWithId(staticId.ToString());
        uint uid        = GetUniqueId();

        if (uid > 0)
        {
            if (name == null)
            {
                name = CreateName.GetRandomSurnnameName((int)uid);
            }

            CharacterBase chBase = new CharacterBase();
            chBase.uid        = uid;
            chBase.staticData = staticData;

            chBase.items  = new HashSet <uint>();
            chBase.equips = new HashSet <uint>();
            chBase.skills = new List <SkillData>();
            // 默认添加空手为武器
            chBase.equips.Add(1);

            // 设置名字和等级
            chBase.charName = name;
            chBase.Level    = level;
            chBase.position = pos;

            // 初始化满血
            chBase.HP    = 1;
            chBase.SP    = 1;
            chBase.MaxHP = 1;
            chBase.MaxSP = 1;

            chBase.UpdateAttribute();

            Debug.LogError(name + " " + chBase.HP + "/" + chBase.MaxHP);
            return(chBase);
        }
        else
        {
            return(null);
        }
    }
Example #6
0
        public override int GetHashCode()
        {
            int hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this

            hashCode = hashCode * 23 + Id.GetHashCode();
            hashCode = hashCode * 23 + (Fid == null ? 0 : Fid.GetHashCode());
            hashCode = hashCode * 23 + (EnableDate == null ? 0 : EnableDate.GetHashCode());
            hashCode = hashCode * 23 + (DisableDate == null ? 0 : DisableDate.GetHashCode());
            hashCode = hashCode * 23 + Dr.GetHashCode();
            hashCode = hashCode * 23 + Ts.GetHashCode();
            hashCode = hashCode * 23 + (CreateBy == null ? 0 : CreateBy.GetHashCode());
            hashCode = hashCode * 23 + (CreateDate == null ? 0 : CreateDate.GetHashCode());
            hashCode = hashCode * 23 + (CreateName == null ? 0 : CreateName.GetHashCode());
            hashCode = hashCode * 23 + (UpdateBy == null ? 0 : UpdateBy.GetHashCode());
            hashCode = hashCode * 23 + (UpdateDate == null ? 0 : UpdateDate.GetHashCode());
            hashCode = hashCode * 23 + (UpdateName == null ? 0 : UpdateName.GetHashCode());
            hashCode = hashCode * 23 + (TableName == null ? 0 : TableName.GetHashCode());
            hashCode = hashCode * 23 + (ColName == null ? 0 : ColName.GetHashCode());
            hashCode = hashCode * 23 + (ColComment == null ? 0 : ColComment.GetHashCode());
            hashCode = hashCode * 23 + (ColDefault == null ? 0 : ColDefault.GetHashCode());
            hashCode = hashCode * 23 + (ColType == null ? 0 : ColType.GetHashCode());
            hashCode = hashCode * 23 + ColProperty.GetHashCode();
            hashCode = hashCode * 23 + ColLength.GetHashCode();
            hashCode = hashCode * 23 + DisplayWidth.GetHashCode();
            hashCode = hashCode * 23 + ColOrder.GetHashCode();
            hashCode = hashCode * 23 + ColPrecision.GetHashCode();
            hashCode = hashCode * 23 + NullAble.GetHashCode();
            hashCode = hashCode * 23 + ShowAble.GetHashCode();
            hashCode = hashCode * 23 + IsDefaultCol.GetHashCode();
            hashCode = hashCode * 23 + (CtrlType == null ? 0 : CtrlType.GetHashCode());
            hashCode = hashCode * 23 + (RefTable == null ? 0 : RefTable.GetHashCode());
            hashCode = hashCode * 23 + (RefID == null ? 0 : RefID.GetHashCode());
            hashCode = hashCode * 23 + (RefCode == null ? 0 : RefCode.GetHashCode());
            hashCode = hashCode * 23 + (RefName == null ? 0 : RefName.GetHashCode());
            hashCode = hashCode * 23 + (RefCondition == null ? 0 : RefCondition.GetHashCode());
            hashCode = hashCode * 23 + (RefCols == null ? 0 : RefCols.GetHashCode());
            hashCode = hashCode * 23 + (RefType == null ? 0 : RefType.GetHashCode());
            hashCode = hashCode * 23 + (MainTable == null ? 0 : RefType.GetHashCode());
            hashCode = hashCode * 23 + (MainTableCol == null ? 0 : MainTableCol.GetHashCode());
            hashCode = hashCode * 23 + (CalculationExpr == null ? 0 : CalculationExpr.GetHashCode());
            return(hashCode);
        }
Example #7
0
        public void createFileListVarI連番なし()
        {
            var list = CreateName.createFileListVarI("test", 100, true);

            Assert.IsNull(list);
        }
Example #8
0
 void Awake()
 {
     gameObject.AddComponent <CreateName>();
     _CreateName = gameObject.GetComponent <CreateName>();
 }
Example #9
0
 public void RandomName()
 {
     inputName.text = CreateName.GetRandomSurnnameName((int)(Time.time * 1000));
 }