Ejemplo n.º 1
0
 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");
 }
Ejemplo n.º 2
0
        public virtual void ReadData(MyData.Reader reader)
        {
            Pos.Value = reader.Vec2i("pos");

            ID        = reader.UInt64("id");
            MyGroupID = reader.UInt64("myGroup");

            IsIDRegistered = reader.Bool("isIDRegistered");
        }
Ejemplo n.º 3
0
            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);
            }
Ejemplo n.º 4
0
        //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");
        }
Ejemplo n.º 5
0
            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");
            }
Ejemplo n.º 6
0
        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");
        }
Ejemplo n.º 7
0
        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;
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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();
            }
        }
Ejemplo n.º 13
0
 public void ReadData(MyData.Reader reader)
 {
     NStartingChars        = reader.Int("nStartingChars");
     StartingStatAbilities = reader.Float("startingStatAbilities");
 }
Ejemplo n.º 14
0
 public void ReadData(MyData.Reader reader)
 {
     Name.Value            = reader.String("name");
     Gender.Value          = (Genders)reader.Int("gender");
     AppearanceIndex.Value = reader.Int("appearanceIndex");
 }
Ejemplo n.º 15
0
 public void ReadData(MyData.Reader reader)
 {
     turnPriority_Player  = reader.Int("turnPriority_Player");
     turnPriority_Monster = reader.Int("turnPriority_Monster");
 }
Ejemplo n.º 16
0
 //Serialization stuff:
 public void ReadData(MyData.Reader reader)
 {
     reader.Structure(Noise, "noise");
 }
Ejemplo n.º 17
0
 public virtual void ReadData(MyData.Reader reader)
 {
     IsEmergency.Value    = reader.Bool("isEmergency");
     SuccessMessage.Value = reader.String("successMessage");
 }
Ejemplo n.º 18
0
 public void ReadData(MyData.Reader reader)
 {
     defaultMaxEnemyDistSqr = reader.Int("maxEnemyDistSqr");
     enemyDistHeuristicMax  = reader.Float("enemyDistHeuristicMax");
 }
Ejemplo n.º 19
0
 protected override Group Read(MyData.Reader reader, string name)
 {
     return(Group.Read(TheMap, name, reader));
 }
Ejemplo n.º 20
0
 //Serialization stuff:
 public void ReadData(MyData.Reader reader)
 {
     reader.Structure(Noise, "noise");
     Exponent  = reader.Float("exponent");
     Threshold = reader.Float("threshold");
 }