Beispiel #1
0
 public Player()
 {
     Position = new Coordinate(0, new Index3(8038, 73908, 80), Vector3.Zero);
     Velocity = new Vector3(0, 0, 0);
     Inventory = new List<InventorySlot>();
     Radius = 0.75f;
     Angle = 0f;
     Height = 3.5f;
     Mass = 100;
     FlyMode = false;
 }
Beispiel #2
0
 /// <summary>
 /// Erzeugt eine neue Player-Instanz an der Default-Position.
 /// </summary>
 public Player()
 {
     Position = new Coordinate(0, new Index3(0, 0, 100), Vector3.Zero);
     Velocity = new Vector3(0, 0, 0);
     Inventory = new List<InventorySlot>();
     Tools = new InventorySlot[TOOLCOUNT];
     Radius = 0.75f;
     Angle = 0f;
     Height = 3.5f;
     Mass = 100;
     FlyMode = false;
     InventoryLimit = 1000;
 }
Beispiel #3
0
        /// <summary>
        /// Deserialisiert die Entität aus dem angegebenen BinaryReader.
        /// </summary>
        /// <param name="reader">Der BinaryWriter, mit dem gelesen wird.</param>
        /// <param name="definitionManager">Der aktuell verwendete <see cref="IDefinitionManager"/>.</param>
        public virtual void Deserialize(BinaryReader reader, IDefinitionManager definitionManager)
        {
            // Position
            int planet = reader.ReadInt32();
            int blockX = reader.ReadInt32();
            int blockY = reader.ReadInt32();
            int blockZ = reader.ReadInt32();
            float posX = reader.ReadSingle();
            float posY = reader.ReadSingle();
            float posZ = reader.ReadSingle();
            Position = new Coordinate(planet, new Index3(blockX, blockY, blockZ), new Vector3(posX, posY, posZ));

            // Mass
            Mass = reader.ReadSingle();
        }