コード例 #1
0
            public T ConvertFrom <T>(Database.Tuple source, object value)
            {
                if (value == null)
                {
                    value = new ParameterHolder(source);
                    source.SetRawValue(ClientItemAttributes.Parameters, value);
                }

                return((T)value);
            }
コード例 #2
0
            public T ConvertFrom <T>(Database.Tuple source, object value)
            {
                if (value == null)
                {
                    value = new Evolution();
                    source.SetRawValue(ServerPetAttributes.Evolution, value);
                }

                return((T)value);
            }
コード例 #3
0
            public object ConvertTo(Database.Tuple source, object value)
            {
                if (source == null)
                {
                    return(value);
                }

                if (value == null)
                {
                    return("0");
                }

                if (value is string && (string)value == "")
                {
                    return("0");
                }

                int ival;

                if (Int32.TryParse(value.ToString(), out ival))
                {
                    bool refineable = source.GetValue <bool>(ServerItemAttributes.Refineable);
                    if (!refineable)
                    {
                        if (ival == 4 || ival == 5)
                        {
                            source.SetRawValue(ServerItemAttributes.Refineable, "0");
                        }
                        else
                        {
                            source.SetRawValue(ServerItemAttributes.Refineable, "");
                        }
                    }

                    //if (AllLoaders.GetServerType() == ServerType.RAthena) {
                    //}
                }

                return(value);
            }
コード例 #4
0
            public object Get(Database.Tuple source, object value)
            {
                if (value == null || (value is string && (string)value == ""))
                {
                    var mobDb    = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Mobs);
                    var mobTuple = mobDb.TryGetTuple(source.GetKey <int>());

                    if (mobTuple != null)
                    {
                        value = mobTuple.GetStringValue(ServerMobAttributes.IRoName.Index);
                        source.SetRawValue(ServerPetAttributes.JName, value);
                    }
                }

                return(value);
            }
コード例 #5
0
            public object ConvertTo(Database.Tuple source, object value)
            {
                string newObject = value.ToString();

                if (!newObject.StartsWith("\r\n"))
                {
                    newObject = newObject.Insert(0, "\r\n");
                }

                if (!newObject.EndsWith("\r\n"))
                {
                    newObject += "\r\n";
                }

                if (source != null)
                {
                    source.SetRawValue(ClientItemAttributes.Parameters, null);
                }

                return(newObject);
            }