Exemple #1
0
    public DBProperty GetDBProperty(EProperty property)
    {
        DBProperty db = null;

        DictProperty.TryGetValue(property, out db);
        return(db);
    }
Exemple #2
0
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBGem> dict)
    {
        DBGem db = new DBGem();

        db.Id      = query.GetInt("Id");
        db.Name    = query.GetString("Name");
        db.Quality = query.GetInt("Quality");
        db.Suit    = query.GetInt("Suit");
        db.Exp     = query.GetInt("Exp");
        db.Pos     = query.GetInt("Pos");

        for (int i = 1; i <= 3; i++)
        {
            EProperty    k   = (EProperty)query.GetInt("PropertyId" + i);
            int          v   = query.GetInt("PropertyNum" + i);
            int          l   = query.GetInt("UnLockLevel" + i);
            CGemProperty gem = new CGemProperty(k, v, l);

            db.Propertys.Add(gem);
        }

        if (!dict.ContainsKey(db.Id))
        {
            dict.Add(db.Id, db);
        }
    }
Exemple #3
0
 public WorldProperty(long ID, EProperty property, bool value)
 {
     ObjectID = ID;
     Property = property;
     Key      = new PropertyKey(ID, property);
     Value    = new PropertyValue(value);
 }
    public static IEnumerable <Entity> Where <TEnum>(this IEnumerable <Entity> entities, TEnum[] properties, int[] values) where TEnum : struct
    {
        IEnumerable <Entity> result = entities.Select(e => e);

        for (int index = 0; index <= properties.Length - 1; index++)
        {
            EProperty property = (EProperty)(object)properties[index];
            int       value    = values[index];
            switch (property)
            {
            case EProperty.Prop1:
                result = result.Where(e => Math.Abs(e.Prop1) >= value);
                break;

            case EProperty.Prop2:
                result = result.Where(e => Math.Abs(e.Prop2) >= value);
                break;

            case EProperty.Prop3:
                result = result.Where(e => Math.Abs(e.Prop3) >= value);
                break;

            case EProperty.Prop4:
                result = result.Where(e => Math.Abs(e.Prop4) >= value);
                break;
            }
        }
        return(result);
    }
Exemple #5
0
 public WorldProperty(WorldProperty property, PropertyValue overwriteValue)
 {
     ObjectID = property.ObjectID;
     Property = property.Property;
     Key      = property.Key;
     Value    = overwriteValue;
 }
    /// <summary>
    /// 根据枚举id创建对应属性对象
    /// </summary>
    private Property CreateProperty(EProperty id)
    {
        var property = new Property();

        propertyDict.Add(id, property);
        return(property);
    }
    public static IEnumerable <Entity> Where(this IEnumerable <Entity> entities, EProperty[] properties, int[] values)
    {
        IEnumerable <Entity> result = entities.Select(e => e);

        for (int index = 0; index <= properties.Length - 1; index++)
        {
            EProperty property = properties[index];
            int       value    = values[index];

            switch (property)
            {
            case EProperty.Prop1:
                result = result.Where(e => e.Prop1 >= value);
                break;

            case EProperty.Prop2:
                result = result.Where(e => e.Prop2 >= value);
                break;

            case EProperty.Prop3:
                result = result.Where(e => e.Prop3 >= value);
                break;

            case EProperty.Prop4:
                result = result.Where(e => e.Prop4 >= value);
                break;
            }
        }
        return(result);
    }
Exemple #8
0
 public void AddProperty(EProperty property, int value)
 {
     if (value >= 0)
     {
         Propertys.Add(property, value);
     }
 }
Exemple #9
0
        public WorldProperty(long ID, EProperty property, int i, bool b, float f)
        {
            ObjectID = ID;
            Property = property;

            Key   = new PropertyKey(ID, property);
            Value = new PropertyValue(i, b, f);
        }
Exemple #10
0
        public WorldProperty(ObjectClass type, int index, EProperty property, int i, bool b, float f)
        {
            ObjectID = GetObjectID(type, index);
            Property = property;

            Key   = new PropertyKey(ObjectID, Property);
            Value = new PropertyValue(i, b, f);
        }
Exemple #11
0
 /// <summary>
 /// 获得属性
 /// </summary>
 private Property GetProperty(EProperty id)
 {
     if (propertyDict.ContainsKey(id))
     {
         return(propertyDict[id]);
     }
     return(CreateProperty(id));
 }
Exemple #12
0
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBFashion> dict)
    {
        DBFashion db = new DBFashion();

        db.Id = query.GetInt("Id");
        for (int i = 1; i <= 2; i++)
        {
            EProperty e = (EProperty)query.GetInt("PropertyId" + i);
            int       v = query.GetInt("PropertyNum" + i);
            KeyValuePair <EProperty, int> fp = new KeyValuePair <EProperty, int>(e, v);
            db.Propertys.Add(fp);
        }

        if (!dict.ContainsKey(db.Id))
        {
            dict.Add(db.Id, db);
        }
    }
Exemple #13
0
        public void FromRuntimeProperty(WorldProperty property, bool generateGuid)
        {
            _objectType  = property.GetObjectClass();
            _objectIndex = property.GetClassIndex();

            Property = property.Property;

            iValue = property.Value.iVal;
            bValue = property.Value.bVal;
            fValue = property.Value.fVal;
            if (generateGuid)
            {
#if UNITY_EDITOR
                guid = GUID.Generate().ToString();
#else
                Debug.LogError("Can't generate guid in a build");
#endif //UNITY_EDITOR
            }
        }
Exemple #14
0
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBRelics> dict)
    {
        DBRelics db = new DBRelics();

        db.Id   = query.GetInt("Id");
        db.Name = query.GetString("Name");
        db.Icon = query.GetString("Icon");
        for (int i = 1; i <= 3; i++)
        {
            EProperty p   = (EProperty)query.GetInt("PropertyID" + i);
            int       num = query.GetInt("PropertyNum" + i);
            db.PropertyID[i - 1]  = p;
            db.PropertyNum[i - 1] = num;
        }

        db.Model          = query.GetString("Model");
        db.ActiveEffectID = query.GetInt("ActiveEffectID");
        db.DitiveEffectID = query.GetInt("DitiveEffectID");

        for (int i = 1; i <= 5; i++)
        {
            int exp = query.GetInt("LevelExp" + i);
            db.LevelRequireExp[i - 1] = exp;
        }
        for (int i = 1; i <= 3; i++)
        {
            int id = query.GetInt("ArtificeCostID" + i);
            db.ArtificeCostID[i - 1] = id;
        }
        db.Desc        = query.GetString("Desc");
        db.StagePos    = query.GetString("StagePos").ToVector3(true);
        db.StageEuler  = query.GetString("StageEuler").ToVector3(true);
        db.StageScale  = query.GetFloat("StageScale");
        db.SkillID     = query.GetInt("SkillID");
        db.AddProperty = query.GetInt("AddProperty");

        if (!dict.ContainsKey(db.Id))
        {
            dict[db.Id] = db;
        }
    }
Exemple #15
0
 internal void CallPropertyChangeHandler(object sender, EProperty AType, int AValue, ref bool AAllowed)
 {
     // Check Event Handler at first.
     if (OnPropertyChange != null)
     {
         // The Event Handler is assigned.
         // Create the EventArg object.
         PropertyChangeEventArg pArg = new PropertyChangeEventArg();
         // Assign the parameter values to
         // EventArg object.
         pArg.Type    = AType;
         pArg.Value   = AValue;
         pArg.Allowed = AAllowed;
         // Call the event.
         DispatchEvent(OnPropertyChange, new object[] { sender, pArg });
         // Check if the reference parameter "Allowed"
         // was set from the process the validate
         // the event.
         AAllowed = pArg.Allowed;
     }
 }
Exemple #16
0
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBEquipAdvance> dict)
    {
        DBEquipAdvance db = new DBEquipAdvance();

        db.Id      = query.GetInt("Id");
        db.Name    = query.GetString("Name");
        db.Quality = query.GetInt("Quality");

        for (int i = 1; i <= 8; i++)
        {
            EProperty key   = (EProperty)query.GetInt("PropertyId" + i);
            int       value = query.GetInt("PropertyNum" + i);
            KeyValuePair <EProperty, int> e = new KeyValuePair <EProperty, int>(key, value);
            db.Propertys.Add(e);
        }

        if (!dict.ContainsKey(db.Id))
        {
            dict.Add(db.Id, db);
        }
    }
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBPartnerAdvance> dict)
    {
        DBPartnerAdvance db = new DBPartnerAdvance();

        db.Id          = query.GetInt("Id");
        db.Partner     = query.GetInt("Partner");
        db.Advance     = query.GetInt("Advance");
        db.CostSoulNum = query.GetInt("CostSoulNum");
        db.MainTarget  = query.GetInt("MainTarget");
        db.ViceTarget  = query.GetInt("ViceTarget");
        db.Desc1       = query.GetString("Desc1");
        db.Desc2       = query.GetString("Desc2");

        for (int i = 1; i <= 2; i++)
        {
            int mainID = query.GetInt("MainID" + i);
            int viceID = query.GetInt("ViceID" + i);
            if (mainID > 0)
            {
                EProperty id  = (EProperty)mainID;
                int       num = query.GetInt("MainNum" + i);
                db.MainPropertys.Add(id, num);
            }
            if (viceID > 0)
            {
                EProperty id  = (EProperty)viceID;
                int       num = query.GetInt("ViceNum" + i);
                db.VicePropertys.Add(id, num);
            }
        }

        if (!dict.ContainsKey(db.Id))
        {
            dict[db.Id] = db;
        }
    }
Exemple #18
0
    protected override void LoadData(SQLiteQuery query, Dictionary <int, DBEquipSuit> dict)
    {
        DBEquipSuit db = new DBEquipSuit();

        db.Id   = query.GetInt("Id");
        db.Name = query.GetString("Name");

        for (int i = 1; i <= 3; i++)
        {
            string[] suit = query.GetString("Suit" + i).Split(new char[1] {
                '|'
            }, StringSplitOptions.RemoveEmptyEntries);
            string[] idArray = query.GetString("SuitPropertyId" + i).Split(new char[1] {
                '|'
            }, StringSplitOptions.RemoveEmptyEntries);
            Dictionary <EProperty, int> d = new Dictionary <EProperty, int>();
            for (int j = 0; j < suit.Length; j++)
            {
                EProperty e = (EProperty)idArray[j].ToInt32();
                int       v = suit[j].ToInt32();
                if (!d.ContainsKey(e))
                {
                    d.Add(e, v);
                }
            }
            if (!db.SuitPropertys.Contains(d))
            {
                db.SuitPropertys.Add(d);
            }
        }

        if (!dict.ContainsKey(db.Id))
        {
            dict.Add(db.Id, db);
        }
    }
Exemple #19
0
 public CGemProperty(EProperty e, int v, int l)
 {
     Property    = e;
     Value       = v;
     UnLockLevel = l;
 }
Exemple #20
0
 public PropertyStat(EProperty property)
 {
     Properties = new List <EProperty>();
     Properties.Add(property);
 }
Exemple #21
0
 public float GetPropertyValua(EProperty id)
 {
     return(0);
 }
Exemple #22
0
 public EConstant(string type, string name, string value) : base(name)
 {
     Prop  = new EProperty(type, name);
     Value = value;
 }
Exemple #23
0
 public PropertyKey(long id, EProperty property)
 {
     ObjectID  = id;
     _property = (int)property;
 }
Exemple #24
0
 public EDeclaration(string type, string name) : base(name)
 {
     Prop = new EProperty(type, name);
 }