/// <summary> /// Leave out peer if this is a AI controlled enity. /// </summary> public Entity(string name, Vector position, string team, Attribute[] attributes, MMOPeer peer) { // TODO: Create AIEntity deriving from this class. Name = name; Position = position; Team = team; if (peer != null) { Peer = peer; m_AiControlled = false; } else { m_AiControlled = true; } if (attributes != null) { foreach (Attribute attribute in attributes) { m_Attributes.Add(attribute.AttributeCode, attribute); attribute.SetEntity(this); } } log.InfoFormat("Created {0} at {1} in team {2}", name, position, team); }
internal Entity CreateClientEntity(MMOPeer peer, EnterWorldRequest operation) { var position = GetRandomWorldPosition(); var maxHealth = GetMaxHealth((WeaponCode)operation.Weapon); var attributes = new Attribute[] { new IntAttribute(maxHealth, AttributeCode.MaxHealth), new HealthAttribute(maxHealth), new ActionStateAttribute(), new FloatAttribute(7f, AttributeCode.Speed) }; var skills = operation.Skills; Array.Resize(ref skills, skills.Length + 1); skills[skills.Length - 1] = operation.Weapon; var entity = new ClientEntity(operation.Name, position, operation.Team, attributes, peer, skills); World.Instance.AddEntity(entity); return(entity); }
internal InitialOperationHandler(MMOPeer peer) { m_Peer = peer; }
public ClientEntity(string name, Vector position, string team, Attribute[] attributes, MMOPeer peer, int[] skillData) : base(name, position, team, attributes, peer) { EquippedSkills = new SkillCollection(skillData); }
internal EntityOperationHandler(MMOPeer peer) { m_Peer = peer; }