using System;
using System.Collections.Generic;
using MinecraftClient.Inventory;
namespace MinecraftClient.Mapping
{
///
/// Represents an entity evolving into a Minecraft world
///
public class Entity
{
///
/// ID of the entity on the Minecraft server
///
public int ID;
///
/// UUID of the entity if it is a player.
///
public Guid UUID;
///
/// Nickname of the entity if it is a player.
///
public string Name;
///
/// CustomName of the entity.
///
public string CustomNameJson;
///
/// IsCustomNameVisible of the entity.
///
public bool IsCustomNameVisible;
///
/// CustomName of the entity.
///
public string CustomName;
///
/// Latency of the entity if it is a player.
///
public int Latency;
///
/// Entity type
///
public EntityType Type;
///
/// Entity location in the Minecraft world
///
public Location Location;
///
/// Entity head yaw
///
/// Untested
public float Yaw = 0;
///
/// Entity head pitch
///
/// Untested
public float Pitch = 0;
///
/// Health of the entity
///
public float Health;
///
/// Item of the entity if ItemFrame or Item
///
public Item Item;
///
/// Entity pose in the Minecraft world
///
public EntityPose Pose;
///
/// Entity metadata
///
public Dictionary Metadata;
///
/// Entity equipment
///
public Dictionary Equipment;
///
/// Create a new entity based on Entity ID, Entity Type and location
///
/// Entity ID
/// Entity Type Enum
/// Entity location
public Entity(int ID, EntityType type, Location location)
{
this.ID = ID;
this.Type = type;
this.Location = location;
this.Health = 1.0f;
this.Equipment = new Dictionary();
this.Item = new Item(ItemType.Air, 0, null);
}
///
/// Create a new entity based on Entity ID, Entity Type and location
///
/// Entity ID
/// Entity Type Enum
/// Entity location
public Entity(int ID, EntityType type, Location location, byte yaw, byte pitch)
{
this.ID = ID;
this.Type = type;
this.Location = location;
this.Health = 1.0f;
this.Equipment = new Dictionary();
this.Item = new Item(ItemType.Air, 0, null);
this.Yaw = yaw * (1 / 256) * 360; // to angle in 360 degree
this.Pitch = pitch * (1 / 256) * 360;
}
///
/// Create a new entity based on Entity ID, Entity Type, location, name and UUID
///
/// Entity ID
/// Entity Type Enum
/// Entity location
/// Player uuid
/// Player name
public Entity(int ID, EntityType type, Location location, Guid uuid, string name)
{
this.ID = ID;
this.Type = type;
this.Location = location;
this.UUID = uuid;
this.Name = name;
this.Health = 1.0f;
this.Equipment = new Dictionary();
this.Item = new Item(ItemType.Air, 0, null);
}
}
}