public T ConvertFrom <T>(Database.Tuple source, object value) { if (value == null) { value = new ParameterHolder(source); source.SetRawValue(ClientItemAttributes.Parameters, value); } return((T)value); }
public T ConvertFrom <T>(Database.Tuple source, object value) { if (value == null) { value = new Evolution(); source.SetRawValue(ServerPetAttributes.Evolution, value); } return((T)value); }
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); }
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); }
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); }