public void ReadData(MyData.Reader reader) { Kf = new Keyframe(); Kf.time = reader.Float("t"); Kf.value = reader.Float("val"); Kf.inTangent = reader.Float("inTangent"); Kf.outTangent = reader.Float("outTangent"); }
public virtual void ReadData(MyData.Reader reader) { Pos.Value = reader.Vec2i("pos"); ID = reader.UInt64("id"); MyGroupID = reader.UInt64("myGroup"); IsIDRegistered = reader.Bool("isIDRegistered"); }
public void ReadData(MyData.Reader reader) { Level = reader.Int("level"); ExitedUnitIDs.Clear(); reader.Collection("exitedUnitIDs", (MyData.Reader rd, ref ulong id, string name) => { id = rd.UInt64(name); }, i => ExitedUnitIDs); }
//Serialization stuff: public void ReadData(MyData.Reader reader) { NRooms = reader.Int("nRooms"); RoomSpacing = reader.Int("roomSpacing"); MinCirclesPerRoom = reader.Int("minCirclesPerRoom"); MaxCirclesPerRoom = reader.Int("maxCirclesPerRoom"); CirclePosVariance = reader.Float("circlePosVariance"); CircleMinRadius = reader.Float("circleMinRadius"); CircleMaxRadius = reader.Float("circleMaxRadius"); }
public void ReadData(MyData.Reader reader) { Name = reader.String("name"); Size = reader.Int("size"); Seed = reader.String("seed"); reader.Structure(Biome, "biome"); reader.Structure(Deposits, "deposits"); reader.Structure(Rooms, "rooms"); reader.Structure(CA, "ca"); reader.Structure(PlayerChars, "playerChars"); }
public void ReadData(MyData.Reader reader) { MoveToPos_MaxDist.Value = reader.Int("moveToPos_MaxDist"); AcceptJob_Mining.Value = reader.Bool("acceptJob_Mining"); AcceptJob_Build.Value = reader.Bool("acceptJob_Build"); SleepWhen_EnergyBelow.Value = reader.Float("sleepWhen_EnergyBelow"); SleepWhen_HealthBelow.Value = reader.Float("sleepWhen_HealthBelow"); GrowingUpIsEmergency.Value = reader.Bool("growingUpIsEmergency"); }
public void ReadData(MyData.Reader reader) { NIterations = reader.Int("nIterations"); TileVariation = reader.Float("tileVariation"); KeyframeSerializer kfs = new KeyframeSerializer(); Keyframe[] keyframes = reader.Collection( "tileChangeChances", (MyData.Reader r, ref Keyframe outVal, string name) => { r.Structure(kfs, name); outVal = kfs.Kf; }, (size) => new Keyframe[size], (i, _kfs, kf) => _kfs[i] = kf); TileChangeChances.keys = keyframes; }
public static Unit Read(MyData.Reader reader, Map theMap, string name) { Unit u = null; Types type = (Types)reader.UInt(name + "_Type"); switch (type) { case Types.PlayerChar: u = new Units.PlayerChar(theMap); break; case Types.Bed: u = new Units.Bed(theMap); break; case Types.LizardMan: u = new Units.LizardMan(theMap); break; default: throw new NotImplementedException(type.ToString()); } reader.Structure(u, name + "_Value"); return(u); }
public static Group Read(Map theMap, string name, MyData.Reader reader) { Types type = (Types)reader.UInt(name + "_type"); Group g = null; switch (type) { case Types.PlayerChars: g = new Groups.PlayerGroup(theMap); break; case Types.Monsters: g = new Groups.MonstersGroup(theMap); break; default: throw new NotImplementedException(type.ToString()); } reader.Structure(g, name + "_value"); return(g); }
public static Job Read(MyData.Reader reader, string name, Map theMap) { Types jType = (Types)reader.Int(name + "_Type"); Job j = null; switch (jType) { case Types.MoveToPos: j = new Job_MoveToPos(Vector2i.Zero, false, theMap); break; case Types.Mine: j = new Job_Mine(new HashSet <Vector2i>(), false, theMap); break; case Types.BuildBed: new Job_BuildBed(Vector2i.Zero, 0, false, theMap); break; case Types.SleepBed: new Job_SleepBed(false, theMap); break; case Types.GrowUp: new Job_GrowUp(false, theMap); break; default: throw new NotImplementedException(jType.ToString()); } reader.Structure(j, name + "_Value"); return(j); }
public virtual void ReadData(MyData.Reader reader) { ID = reader.UInt64("id"); TurnPriority.Value = reader.Int("turnPriority"); UnitsByID.Clear(); reader.Collection("units", (MyData.Reader r, ref ulong outID, string name) => { outID = r.UInt64(name); }, (size) => UnitsByID); AlliesByID.Clear(); reader.Collection("allies", (MyData.Reader r, ref ulong outID, string name) => { outID = r.UInt64(name); }, (size) => AlliesByID); EnemiesByID.Clear(); reader.Collection("enemies", (MyData.Reader r, ref ulong outID, string name) => { outID = r.UInt64(name); }, (size) => EnemiesByID); }
public void ReadData(MyData.Reader reader) { Clear(); reader.Structure(Tiles, "tiles"); unitsByPos = new GridSet <Unit>(Tiles.Dimensions); nextID = reader.UInt64("nextID"); reader.Structure(Groups, "groups"); reader.Collection("units", (MyData.Reader rd, ref Unit outUnit, string name) => outUnit = Unit.Read(rd, this, name), (size) => units); foreach (Unit u in units) { AddUnit(u); } foreach (Group g in Groups) { g.FinishDeserialization(); } }
public void ReadData(MyData.Reader reader) { NStartingChars = reader.Int("nStartingChars"); StartingStatAbilities = reader.Float("startingStatAbilities"); }
public void ReadData(MyData.Reader reader) { Name.Value = reader.String("name"); Gender.Value = (Genders)reader.Int("gender"); AppearanceIndex.Value = reader.Int("appearanceIndex"); }
public void ReadData(MyData.Reader reader) { turnPriority_Player = reader.Int("turnPriority_Player"); turnPriority_Monster = reader.Int("turnPriority_Monster"); }
//Serialization stuff: public void ReadData(MyData.Reader reader) { reader.Structure(Noise, "noise"); }
public virtual void ReadData(MyData.Reader reader) { IsEmergency.Value = reader.Bool("isEmergency"); SuccessMessage.Value = reader.String("successMessage"); }
public void ReadData(MyData.Reader reader) { defaultMaxEnemyDistSqr = reader.Int("maxEnemyDistSqr"); enemyDistHeuristicMax = reader.Float("enemyDistHeuristicMax"); }
protected override Group Read(MyData.Reader reader, string name) { return(Group.Read(TheMap, name, reader)); }
//Serialization stuff: public void ReadData(MyData.Reader reader) { reader.Structure(Noise, "noise"); Exponent = reader.Float("exponent"); Threshold = reader.Float("threshold"); }