public PropsSerialized DeepCopy() { PropsSerialized copy = new PropsSerialized(); copy.floats = floats.DeepCopy() as FloatSerialProp; copy.ints = ints.DeepCopy() as IntSerialProp; copy.bools = bools.DeepCopy() as BoolSerialProp; return(copy); }
public static PropsSerialized Serialize(CachedProperties p) { PropsSerialized props = new PropsSerialized(); props.floats.LoadDictionary(p._floats); props.ints.LoadDictionary(p._ints); props.bools.LoadDictionary(p._bools); return(props); }
public static CachedProperties Deserialize(PropsSerialized props) { CachedProperties p = new CachedProperties(); for (int i = 0; i < props.floats.keys.Count; i++) { p._floats.Add(props.floats.keys[i], props.floats.vals[i]); } for (int i = 0; i < props.ints.keys.Count; i++) { p._ints.Add(props.ints.keys[i], props.ints.vals[i]); } for (int i = 0; i < props.bools.keys.Count; i++) { p._bools.Add(props.bools.keys[i], props.bools.vals[i]); } return(p); }