Exemplo n.º 1
0
        public override void ResolveDatumIndices(IDatumIndexResolver <GameObject> objectResolver)
        {
            base.ResolveDatumIndices(objectResolver);

            _primaryWeapon    = objectResolver.ResolveIndex(_primaryWeaponIndex) as WeaponObject;
            _secondaryWeapon  = objectResolver.ResolveIndex(_secondaryWeaponIndex) as WeaponObject;
            _tertiaryWeapon   = objectResolver.ResolveIndex(_tertiaryWeaponIndex) as WeaponObject;
            _quaternaryWeapon = objectResolver.ResolveIndex(_quaternaryWeaponIndex) as WeaponObject;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a new Player object containing player information.
        /// </summary>
        /// <param name="reader">The SaveReader to read from. It must be positioned at the start of the players table.</param>
        /// <param name="objectResolver">The IDatumIndexResolver to use to resolve object indices.</param>
        public Player(SaveReader reader, IDatumIndexResolver <GameObject> objectResolver)
        {
            // Read the first entry from the players table
            Table playerTable = new Table(reader);

            if (playerTable.Name != "players")
            {
                throw new ArgumentException("Player info must be read from the \"players\" table. The save file may be corrupt.");
            }
            playerTable.ReadEntries(reader, ProcessPlayer);

            _biped = objectResolver.ResolveIndex(_bipedIndex) as BipedObject;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Resolves any datum indices that this object refers to.
 /// </summary>
 /// <param name="objectResolver">The IDatumIndexResolver to use for resolving GameObjects.</param>
 public virtual void ResolveDatumIndices(IDatumIndexResolver <GameObject> objectResolver)
 {
     _nextCarried  = objectResolver.ResolveIndex(_nextCarriedIndex);
     _firstCarried = objectResolver.ResolveIndex(_firstCarriedIndex);
     _carrier      = objectResolver.ResolveIndex(_carrierIndex);
 }