Exemple #1
0
 public Player(ClientConnection connection, CharacterData characterData) : base(ObjectFamily.Player)
 {
     Connection = connection;
     DatabaseCharacterData = characterData;
     Position = new Position(new Vector3(characterData.PositionX, characterData.PositionY, characterData.PositionZ));
     Ai = new PlayerAI(this, CfgCore.Default.VisibleRangeDistance);
 }
Exemple #2
0
        public List<ABdoObject> GetObjectsInRange(Position position, float radius, float minradius = 0)
        {
            var obj = new List<ABdoObject>();

            _objects.Action(element =>
            {
                var distance = element.Position.Distance(position);
                if (distance < radius && distance > minradius)
                    obj.Add(element);
            });

            return obj;
        }
Exemple #3
0
 public void UpdateHeading(Position target)
 {
     Heading = (short)(Math.Atan2(target.Point.Y - Point.Y, target.Point.X - Point.X) * 32768 / Math.PI);       
 }
Exemple #4
0
 public double Distance(Position target)
 {
     return Point.Distance(new Vector3(target.Point.X, target.Point.Y, target.Point.Z));
 }
        protected virtual void Rotate(Position target, int time)
        {

        }