Exemple #1
0
        public override bool Load(ISerializeContext ctx)
        {
            if (!base.Load(ctx))
            {
                return(false);
            }

            OccupyingRace      = ctx.Reader.ReadRace();
            Race               = ctx.Reader.ReadRace();
            UnitType           = ctx.Reader.ReadUnitType();
            Total              = ctx.Reader.ReadUInt32();
            Min                = ctx.Reader.ReadUInt32();
            Max                = ctx.Reader.ReadUInt32();
            StrategicalSuccess = ctx.Reader.ReadUInt32();
            OwnerSuccess       = ctx.Reader.ReadUInt32();
            EnemySuccess       = ctx.Reader.ReadUInt32();
            Influence          = ctx.Reader.ReadUInt32();
            Respawn            = ctx.Reader.ReadUInt32();
            Occupier           = ctx.ReadEntity <ICharacter>();
            Owner              = ctx.ReadEntity <ICharacter>();
            Terrain            = ctx.Reader.ReadTerrain();
            Killed             = ctx.Reader.ReadUInt32();
            Lost               = 0;

            return(true);
        }
        public override bool Load(ISerializeContext ctx)
        {
            if (!base.Load(ctx))
            {
                return(false);
            }

            Race         = ctx.Reader.ReadRace();
            UnitType     = ctx.Reader.ReadUnitType();
            Total        = ctx.Reader.ReadUInt32();
            TargetId     = ctx.Reader.ReadMXId();
            Orders       = ctx.Reader.ReadOrders();
            Success      = ctx.Reader.ReadUInt32();
            LoyaltyLord  = ctx.ReadEntity <ICharacter>();
            Killed       = ctx.Reader.ReadUInt32();
            LastLocation = (ctx.Version > 3)
                ? ctx.Reader.ReadLoc()
                : Loc.Zero;
            Delay = (ctx.Version > 6)
                ? ctx.Reader.ReadUInt32()
                : 0;

            Lost           = 0;
            TargetLocation = Loc.Zero;

            return(true);
        }
Exemple #3
0
        public override bool Load(ISerializeContext ctx)
        {
            if (!base.Load(ctx))
            {
                return(false);
            }

            Priority = ctx.Reader.ReadInt32();
            Mission  = ctx.ReadEntity <IMission>();
            String   = ctx.Reader.ReadUInt32();

            return(true);
        }
Exemple #4
0
        public override bool Load(ISerializeContext ctx)
        {
            if (!base.Load(ctx))
            {
                return(false);
            }


            Name           = ctx.Reader.ReadString();
            CarriedBy      = ctx.ReadEntity <IItem>();
            Description    = ctx.Reader.ReadString();
            Kills          = ctx.Reader.ReadThingType();
            UseDescription = ctx.Reader.ReadUInt32();

            return(true);
        }
 public bool Load(ISerializeContext ctx)
 {
     Nodes[0] = ctx.ReadEntity <IRouteNode>();
     Nodes[1] = ctx.ReadEntity <IRouteNode>();
     return(true);
 }
Exemple #6
0
        public override bool Load(ISerializeContext ctx)
        {
            if (!base.Load(ctx))
            {
                return(false);
            }

            LongName  = ctx.Reader.ReadString();
            ShortName = ctx.Reader.ReadString();
            Looking   = ctx.Reader.ReadDirection();
            Time      = ctx.Reader.ReadTime();

            Units.FirstOrDefault()?.Load(ctx);
            Units.LastOrDefault()?.Load(ctx);

            BattleInfo.Load(ctx);

            Reckless = ctx.Reader.ReadUInt32();
            Energy   = ctx.Reader.ReadUInt32();
            Strength = ctx.Reader.ReadUInt32();
            Cowardly = ctx.Reader.ReadUInt32();
            Courage  = ctx.Reader.ReadUInt32();
            Fear     = ctx.Reader.ReadUInt32();

            Recruitment.Load(ctx);

            Race = ctx.Reader.ReadRace();

            var carried = ctx.ReadEntity <IObject>();

            Carrying = carried == null
                ? new List <IObject>().AsReadOnly()
                : new List <IObject> {
                carried
            }.AsReadOnly();

            KilledBy = ctx.ReadEntity <IObject>();

            Gender = ctx.Reader.ReadGender();

            Loyalty = ctx.Reader.ReadRace();

            Liege = ctx.ReadEntity <ICharacter>();

            Foe = ctx.ReadEntity <ICharacter>();

            WaitStatus = ctx.Reader.ReadWaitStatus();

            Orders = ctx.Reader.ReadOrders();

            Despondency = ctx.Reader.ReadUInt32();

            Traits = ctx.Reader.ReadEnum <LordTraits>();

            Following = ctx.Version > 2
                ? ctx.ReadEntity <ICharacter>()
                : null;

            Followers = ctx.Version > 4
                ? ctx.Reader.ReadUInt32()
                : 0;

            // temp bug fix
            if ((int)Energy < 0)
            {
                Energy = 0;
            }

            return(true);
        }