Exemplo n.º 1
0
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="w1"></param>
        /// <param name="wt"></param>
        /// <param name="ignorable"></param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt, List <ArbiterWaypoint> ignorable)
        {
            List <WaypointType> wts = new List <WaypointType>();

            wts.Add(wt);
            return(this.GetNext(w1, wts, ignorable));
        }
Exemplo n.º 2
0
    public void SetupNavWaypoint(CelestialBody targetBody, double latitude, double longitude, double altitude, WaypointType type, Color color)
    {
        this.targetBody = targetBody;
        this.latitude = latitude;
        this.longitude = longitude;
        this.altitude = altitude;

        switch ( type )
        {
            case WaypointType.PLANE:
                indicator.renderer.material.mainTexture = mTexPlane;
                break;
            case WaypointType.ROVER:
                indicator.renderer.material.mainTexture = mTexRover;
                break;
            default:
                indicator.renderer.material.mainTexture = mTexDefault;
                break;
        }

        indicator.renderer.material.SetColor("_Color", color);

        if (targetBody.pqsController != null)
        {
            Vector3d pqsRadialVector = QuaternionD.AngleAxis(longitude, Vector3d.down) * QuaternionD.AngleAxis(latitude, Vector3d.forward) * Vector3d.right;
            height = targetBody.pqsController.GetSurfaceHeight(pqsRadialVector) - targetBody.pqsController.radius;

            if (height < 0)
                height = 0;
        }
    }
Exemplo n.º 3
0
        public Waypoint(MPos position, WaypointLocation location, WaypointType type)
        {
            Position = position;
            Location = location;

            Type = type;
        }
Exemplo n.º 4
0
        public FmsFlightplan CreateFmsFlightplanFromGarminFpl(GarminFpl garminFlightplan)
        {
            List <PlanItem> planItems = new List <PlanItem>();

            foreach (var routepoint in garminFlightplan.Route.Routepoint)
            {
                Waypoint waypointToRoutepoint = garminFlightplan.Waypointtable.Waypoint.Single(x =>
                                                                                               x.Identifier == routepoint.Waypointidentifier && x.Type == routepoint.Waypointtype &&
                                                                                               x.Countrycode == routepoint.Waypointcountrycode);
                double       lat          = waypointToRoutepoint.Lat;
                double       lon          = waypointToRoutepoint.Lon;
                WaypointType waypointType = _fplToFmsWaypointTypeConverter.FplWaypointTypeToFms(waypointToRoutepoint.Type);
                string       id;
                if (waypointType == WaypointType.LatLon)
                {
                    id = CreateIdentifierFromCoordinates(lat, lon);
                }
                else
                {
                    id = waypointToRoutepoint.Identifier;
                }
                planItems.Add(new PlanItem(
                                  waypointType,
                                  id,
                                  0,
                                  lat,
                                  lon)
                              );
            }

            Header header = new Header(planItems.Count - 1);

            return(new FmsFlightplan(header, planItems));
        }
Exemplo n.º 5
0
        public DisplayWaypoint(Serial serial, int x, int y, int z, int mapID, WaypointType type, string name, bool ignoreObject)
            : base(0xE5)
        {
            EnsureCapacity(21 + (name.Length * 2));

            m_Stream.Write(serial);

            m_Stream.Write((ushort)x);
            m_Stream.Write((ushort)y);
            m_Stream.Write((sbyte)z);
            m_Stream.Write((byte)mapID); //map

            m_Stream.Write((ushort)type);

            m_Stream.Write((ushort)(ignoreObject ? 1 : 0));

            if (type == WaypointType.Corpse)
            {
                m_Stream.Write(1046414);
            }
            else
            {
                m_Stream.Write(1062613);
            }

            m_Stream.WriteLittleUniNull(name);

            m_Stream.Write((short)0); // terminate
        }
Exemplo n.º 6
0
 public Waypoint(WaypointType Type, ShopAction ShopAction, uint ItemID, int Amount)
 {
     wType = Type;
     wShopAction = ShopAction;
     wItemID = ItemID;
     wAmount = Amount;
 }
Exemplo n.º 7
0
 public void AddWaypoint(WaypointType waypointType)
 {
     if (!Enable && GlobalVariables.IsConnected())
     {
         Position pos = GlobalVariables.GetPlayerPosition().Clone();
         switch (waypointType)
         {
             case WaypointType.WAYPOINT_GROUND:
             case WaypointType.WAYPOINT_ROPE:
             case WaypointType.WAYPOINT_LADDER:
                 Waypoints.Add(new WalkWaypoint(pos, waypointType));
                 break;
             case WaypointType.WAYPOINT_HOLE:
                 pos.Y++;
                 pos.Z--;
                 Waypoints.Add(new WalkWaypoint(pos, waypointType));
                 break;
             case WaypointType.WAYPOINT_RAMP:
                 break;
             case WaypointType.WAYPOINT_STAIR_UP:
                 pos.Y--;
                 Waypoints.Add(new WalkWaypoint(pos, waypointType));
                 break;
             case WaypointType.WAYPOINT_START_DOWN:
                 pos.Y++;
                 Waypoints.Add(new WalkWaypoint(pos, waypointType));
                 break;
         }
     }
 }
Exemplo n.º 8
0
 public void Initialize(int x, int y, WaypointType type, float timeMultiplier)
 {
     X              = x;
     Y              = y;
     Type           = type;
     TimeMultiplier = timeMultiplier;
 }
Exemplo n.º 9
0
        private void addWaypointByType(WaypointType type)
        {
            if (this.memory.isUseable())
            {
                PlayerPosition p  = this.memory.position();
                Waypoint       wp = new Waypoint();

                wp.position = p;
                wp.type     = type;
                wp.id       = (uint)this.waypointList.Count;

                Single range = Convert.ToSingle(gatheringRangeInputField.Text);

                if (type == WaypointType.Gathering && range >= 1)
                {
                    wp.range = range;
                }
                else
                {
                    wp.range = 0;
                }

                if (type == WaypointType.Default)
                {
                    this.lastAwpWaypoint = wp;
                }
                this.waypointList.Add(wp);
                this.addWaypointToList(wp);
            }
        }
Exemplo n.º 10
0
 public PlanItem(WaypointType typ, string id, double altitude, double latitude, double longitude)
 {
     Typ       = typ;
     Id        = id.MustNotBeNulllOrWhitespace(nameof(id));
     Altitude  = altitude;
     Latitude  = latitude;
     Longitude = longitude;
 }
Exemplo n.º 11
0
        public static void Create(Mobile m, Mobile mob, WaypointType type, bool ignoreObject = false)
        {
            NetState ns = m.NetState;

            if (ns != null && mob != null && !mob.Deleted)
            {
                ns.Send(new DisplayWaypoint(mob.Serial, mob.X, mob.Y, mob.Z, mob.Map.MapID, type, mob.Name + " " + mob.Title, ignoreObject));
            }
        }
Exemplo n.º 12
0
 public Waypoint(WaypointType Type, ConditionalVarType VarType, uint ItemID, ConditionalCheckType CheckType, int Output, string GoToLabel)
 {
     wType = Type;
     wCondVarType = VarType;
     wItemID = ItemID;
     wCondCheckType = CheckType;
     wCondOutput = Output;
     wLabelName = GoToLabel;
 }
Exemplo n.º 13
0
        public static void Create(Mobile m, IEntity e, WaypointType type, string arg, bool ignoreObject = false)
        {
            NetState ns = m.NetState;

            if (ns != null && e != null && !e.Deleted && (!(e is Mobile) || ((Mobile)e).Alive))
            {
                ns.Send(new DisplayWaypoint(e.Serial, e.X, e.Y, e.Z, e.Map.MapID, type, arg, ignoreObject));
            }
        }
Exemplo n.º 14
0
        public static Waypoint FromLocation(WaypointType type, ILocation location)
        {
            if (location == null)
            {
                return(null);
            }

            return(new Waypoint(type, location));
        }
Exemplo n.º 15
0
 public PolygonWaypoint(int id, double x, double y, WaypointType type)
 {
     this.id           = id;
     this.x            = x;
     this.y            = y;
     this.waypointType = type;
     neighbors         = new List <PolygonWaypoint>();
     edgeNum           = -1;
 }
Exemplo n.º 16
0
 public Waypoint(int id, WaypointType type, int xWaypointRange, int yWaypointRange, string label, WaypointLocation location, string action)
 {
     Id             = id;
     Type           = type;
     Label          = label;
     Location       = location;
     Action         = action;
     XWaypointRange = xWaypointRange;
     YWaypointRange = yWaypointRange;
 }
Exemplo n.º 17
0
        public ElevatorWaypoint(uint destinationFloor, WaypointType waypointType)
        {
            this.DestinationFloor = destinationFloor;
            this.WaypointType     = waypointType;

            if (waypointType == WaypointType.PICK_UP)
            {
                throw new InvalidWaypointException("The waypoint must have have an associated next to be type Pick Up");
            }
        }
Exemplo n.º 18
0
 public Waypoint(WaypointType type, WaypointHandler h, Vector2 tileCoords, float depth)
 {
     Type = type;
     handler = h;
     TileCoords = tileCoords;
     if (type == WaypointType.Lift)
         BoundingRectangle = new BoundingBox(new Vector3(tileCoords.X, tileCoords.Y, depth), new Vector3(tileCoords.X + 300, tileCoords.Y + 40, depth));
     else
         BoundingRectangle = new BoundingBox(new Vector3(tileCoords.X, tileCoords.Y, depth), new Vector3(tileCoords.X + 60, tileCoords.Y + 40, depth));
 }
Exemplo n.º 19
0
    private void MoveAgentTo(Vector3 point)
    {
        ClearPathObjects();

        if (!aimAgent.gameObject.activeSelf)
        {
            aimAgent.gameObject.SetActive(true);
        }

        NavMeshPath path = new NavMeshPath();

        navMeshAgent.CalculatePath(point, path);

        switch (path.status)
        {
        case NavMeshPathStatus.PathComplete:
            Debug.Log("PATH IS POSSIBLE!!!! :) ");

            lastPath = WaypointType.Complete;

            navMeshAgent.SetDestination(point);
            if (!aimTarget.gameObject.activeSelf)
            {
                aimTarget.gameObject.SetActive(true);
            }
            aimTarget.position = point;

            foreach (Vector3 pathPoint in path.corners)
            {
                GameObject pathObject = GetWaypoint(lastPath);
                pathObject.transform.SetParent(transform.parent);
                pathObject.transform.position = pathPoint;
                pathObjects.Add(pathObject);
            }
            break;

        case NavMeshPathStatus.PathPartial:
            Debug.Log("ONLY PARTIAL PATH IS POSSIBLE... :( ");

            lastPath = WaypointType.Incomplete;

            foreach (Vector3 pathPoint in path.corners)
            {
                GameObject pathObject = GetWaypoint(lastPath);
                pathObject.transform.SetParent(transform.parent);
                pathObject.transform.position = pathPoint;
                pathObjects.Add(pathObject);
            }
            break;

        case NavMeshPathStatus.PathInvalid:
            Debug.Log("NO PATH POSSIBLE... :( ");
            break;
        }
    }
Exemplo n.º 20
0
        public ElevatorWaypoint(uint destinationFloor, WaypointType waypointType, uint associatedNext)
        {
            this.DestinationFloor = destinationFloor;
            this.WaypointType     = waypointType;

            if (waypointType != WaypointType.PICK_UP)
            {
                throw new InvalidWaypointException("The waypoint must be of type Pick Up to have an associated next");
            }
            this._associatedNext = associatedNext;
        }
Exemplo n.º 21
0
 public Waypoint(WaypointType type, string name, double latitude, double longitude, double altitude, double?bearing = null, string region = null, string airport = null)
 {
     Type      = type;
     Name      = name;
     Region    = region;
     Airport   = airport;
     Latitude  = latitude;
     Longitude = longitude;
     Altitude  = altitude;
     Bearing   = bearing;
 }
Exemplo n.º 22
0
    void Update()
    {
        switch (type){
        case WaypointType.loop: // loops around the waypoints
            if (transform.position == waypoints[waypointIndex].position) {
                if (waypointIndex == waypoints.Length-1){
                    waypointIndex = 0;
                }
                else{
                    waypointIndex ++;
                }
            }

            break;
        case WaypointType.pingPong: // go though the wayponts and back in reverse order
            if (transform.position == waypoints[waypointIndex].position) {
                if (waypointIndex == waypoints.Length-1){
                    isReverse = true;
                }
                if (waypointIndex == 0){
                    isReverse = false;
                }

                if (isReverse) {
                    waypointIndex--;
                }
                else {
                    waypointIndex++;
                }
            }
            break;
        case WaypointType.once: // go through the waypoints and stop at the end
            if (transform.position == waypoints[waypointIndex].position) {
                if (waypointIndex == waypoints.Length - 1){
                    type = WaypointType.off;
                    break;
                }
                else {
                    waypointIndex ++;
                }
            }
            break;
        case WaypointType.random: // go to a random waypoint
            if (transform.position == waypoints[waypointIndex].position) {
                waypointIndex = Random.Range(0, waypoints.Length);
            }
            break;
        case WaypointType.off: // go to the next waypoint on the list and stop
            break;
        }

        transform.position = Vector3.MoveTowards(transform.position, waypoints[waypointIndex].position, Time.deltaTime * speed);
    }
Exemplo n.º 23
0
        public static Waypoint FromAddress(WaypointType type, string address)
        {
            if (address == null)
            {
                return(null);
            }

            return(new Waypoint(type, null)
            {
                Address = address
            });
        }
Exemplo n.º 24
0
        private void typeComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            WaypointType wpt = (WaypointType)this.typeComboBox.SelectedItem;

            if (wpt == WaypointType.Gathering)
            {
                this.rangeTextField.Enabled = true;
            }
            else
            {
                this.rangeTextField.Enabled = false;
            }
        }
        public Waypoint(Vector3 pos, float headingAngle, WaypointType type, float radius)
        {
            Type = type;
            Position = pos;
            HeadingAngle = headingAngle;
            Radius = radius;

            if (type == WaypointType.Hover) SecondsToWait = 2.0f;
            else if (type == WaypointType.Land) SecondsToWait = float.MaxValue;
            else SecondsToWait = 0;

            SecondsWaited = 0;
        }
Exemplo n.º 26
0
    // Returning Waypoints to pool
    public void ReturnWaypointToPool(GameObject waypointToStore, WaypointType wType)
    {
        waypointToStore.SetActive(false);
        if (wType == WaypointType.Complete)
        {
            waypointToStore.transform.SetParent(unusedCompletePool);
        }
        else if (wType == WaypointType.Complete)
        {
            waypointToStore.transform.SetParent(unusedIncompletePool);
        }

        waypointToStore.transform.localScale = Vector3.one;
        waypointToStore.transform.position   = Vector3.zero;
    }
Exemplo n.º 27
0
    public GameObject GetWaypoint(WaypointType wType)
    {
        GameObject wObject = null;

        switch (wType)
        {
        case WaypointType.Complete:
            wObject = unusedCompletePool.GetChild(UnityEngine.Random.Range(0, unusedCompletePool.childCount - 1)).gameObject;
            break;

        case WaypointType.Incomplete:
            wObject = unusedIncompletePool.GetChild(UnityEngine.Random.Range(0, unusedIncompletePool.childCount - 1)).gameObject;
            break;
        }

        wObject.SetActive(true);
        // Return tree with proper material attached to it
        return(wObject);
    }
Exemplo n.º 28
0
        //-----------------------------------------------------------------------------------------------
        public Waypoint(FPoint fp, Waypoint parent, bool done)
        {
            this.type = WaypointType.Normal;
            this.done = done;

            this.parent = parent;
            this.fp     = fp.Clone();

            if (parent == null)
            {
                G = 0;
            }
            else
            {
                G = parent.G + fp.Distance(parent.fp);
            }

            H = fp.Distance(fp_dst);

            F = G + H;
        }
Exemplo n.º 29
0
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="loc">Location to start looking from</param>
        /// <param name="wt">Waypoint type to look for</param>
        /// <param name="ignorable">ignorable waypoints</param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(Coordinates loc, WaypointType wt, List <ArbiterWaypoint> ignorable)
        {
            List <WaypointType> wts = new List <WaypointType>();

            wts.Add(wt);

            SLComponentType closest = this.ClosestComponent(loc);

            if (closest == SLComponentType.Initial)
            {
                return(this.GetNext(this.Initial.GetClosestPartition(loc).Final, wts, ignorable));
            }
            else if (closest == SLComponentType.Final)
            {
                return(this.GetNext(this.Final.GetClosestPartition(loc).Final, wts, ignorable));
            }
            else
            {
                return(this.GetNext(this.Final.GetClosestPartition(loc).Final, wts, ignorable));
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// Gets next waypoint of a certain type ignoring certain waypoints
        /// </summary>
        /// <param name="w1"></param>
        /// <param name="wt"></param>
        /// <param name="ignorable"></param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt, List <ArbiterWaypoint> ignorable)
        {
            ArbiterWaypoint tmp = w1;

            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt) && !ignorable.Contains(tmp))
                {
                    return(tmp);
                }
                if (tmp.NextPartition != null)
                {
                    tmp = tmp.NextPartition.Final;
                }
                else
                {
                    tmp = null;
                }
            }

            return(null);
        }
Exemplo n.º 31
0
        public Waypoint(Vector3 pos, float headingAngle, WaypointType type, float radius)
        {
            Type         = type;
            Position     = pos;
            HeadingAngle = headingAngle;
            Radius       = radius;

            if (type == WaypointType.Hover)
            {
                SecondsToWait = 2.0f;
            }
            else if (type == WaypointType.Land)
            {
                SecondsToWait = float.MaxValue;
            }
            else
            {
                SecondsToWait = 0;
            }

            SecondsWaited = 0;
        }
Exemplo n.º 32
0
    public List <GameObject> SearchPathUnknownTarget(Waypoint initalWaypoint, WaypointType waypointTypeToFind)
    {
        List <GameObject> path    = new List <GameObject>();
        List <Waypoint>   visited = new List <Waypoint>();

        // BFS Style

        /*List<Waypoint> visited = new List<Waypoint>();
         * Queue<Waypoint> q = new Queue<Waypoint>();
         *
         * q.Enqueue(initalWaypoint);
         * visited.Add(initalWaypoint);
         *
         * while (q.Count != 0)
         * {
         *  Waypoint waypoint = q.Dequeue();
         *
         *  if (waypoint.ReturnWaypointType() == waypointTypeToFind)
         *  {
         *      path.Add(waypoint.ReturnWaypointGameObject());
         *      return path;
         *  }
         *
         *  foreach (Waypoint w in waypoint.connectedWaypoints)
         *  {
         *      if (!visited.Contains(w))
         *      {
         *          visited.Add(w);
         *          q.Enqueue(w);
         *      }
         *  }
         * }*/

        path.Add(initalWaypoint.ReturnWaypointGameObject());
        visited.Add(initalWaypoint);
        path = SearchWaypointPathRecursiveType(initalWaypoint, waypointTypeToFind, path, visited);

        return(path);
    }
Exemplo n.º 33
0
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="w1">Starting waypoint of search</param>
        /// <param name="wt">Waypoint type to look for</param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt)
        {
            ArbiterWaypoint tmp = w1;

            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt))
                {
                    return(tmp);
                }

                if (tmp.NextPartition != null)
                {
                    tmp = tmp.NextPartition.Final;
                }
                else
                {
                    tmp = null;
                }
            }

            return(null);
        }
 /// <summary>
 /// Type off a waypoint
 /// </summary>
 /// <param name="wt"></param>
 /// <returns></returns>
 public bool WaypointTypeEquals(WaypointType wt)
 {
     if (wt == WaypointType.End)
     {
         return(this.NextPartition == null ? true : false);
     }
     else if (wt == WaypointType.Entry)
     {
         return(this.isEntry);
     }
     else if (wt == WaypointType.Exit)
     {
         return(this.isExit);
     }
     else if (wt == WaypointType.Stop)
     {
         return(this.IsStop);
     }
     else
     {
         return(this.PreviousPartition == null);
     }
 }
Exemplo n.º 35
0
    private List <GameObject> SearchWaypointPathRecursiveType(
        Waypoint currentWaypoint,
        WaypointType waypointTypeToFind,
        List <GameObject> list,
        List <Waypoint> visited)
    {
        // Check for base case
        if (currentWaypoint.ReturnWaypointType() == waypointTypeToFind)
        {
            return(list);
        }

        // int i = 0;

        // check for other posibilties
        foreach (Waypoint w in currentWaypoint.connectedWaypoints)
        {
            //Debug.Log(i);
            //i++;
            if (visited.Contains(w) == false)
            {
                visited.Add(w);
                list.Add(w.ReturnWaypointGameObject());
                SearchWaypointPathRecursiveType(w, waypointTypeToFind, list, visited);

                if (list[list.Count - 1].GetComponent <Waypoint>().ReturnWaypointType() == waypointTypeToFind)
                {
                    return(list);
                }

                list.Remove(w.ReturnWaypointGameObject());
            }
        }

        return(list);
    }
Exemplo n.º 36
0
    private Vector3 getPosition(Vector3 origin, Vector3 target, float progress, WaypointType type)
    {
        Vector3 position = Vector3.Lerp(origin, target, progress);

        float arcHeight = 0f;

        switch (type)
        {
        case WaypointType.HorizontalJump:
        case WaypointType.HorizontalJumpDown:
            arcHeight   = .5f;
            position.y += Mathf.Sin(progress * Mathf.PI) * arcHeight;
            break;

        case WaypointType.WalkOffDown:
            if (progress <= .5f)
            {
                position.y = origin.y;
            }
            else
            {
                position.y = Mathf.Lerp(origin.y, target.y, (progress - .5f) * 2);
            }
            break;

        case WaypointType.VerticalJumpUp:
            float yDiff = target.y - origin.y;
            arcHeight = yDiff / 2 + .5f;
            float subProgress = Mathf.Clamp(progress * 1.5f, 0, 1);
            position.y  = Mathf.Lerp(origin.y, target.y, subProgress);
            position.y += Mathf.Sin(subProgress * Mathf.PI) * arcHeight;
            break;
        }

        return(position);
    }
        /// <summary>
        /// Gets next waypoint of a certain type ignoring certain waypoints
        /// </summary>
        /// <param name="w1"></param>
        /// <param name="wt"></param>
        /// <param name="ignorable"></param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt, List<ArbiterWaypoint> ignorable)
        {
            ArbiterWaypoint tmp = w1;
            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt) && !ignorable.Contains(tmp))
                    return tmp;
                if (tmp.NextPartition != null)
                    tmp = tmp.NextPartition.Final;
                else
                    tmp = null;
            }

            return null;
        }
Exemplo n.º 38
0
 public PolygonWaypoint(int id, double x, double y, WaypointType type) {
     this.id = id;
     this.x = x;
     this.y = y;
     this.waypointType = type;
     neighbors = new List<PolygonWaypoint>();
     edgeNum = -1;
 }
 /// <summary>
 /// Get the next waypoint of a certain type
 /// </summary>
 /// <param name="w1">Starting waypoint of search</param>
 /// <param name="wt">Waypoint type to look for</param>
 /// <returns></returns>
 public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt)
 {
     return this.GetNext(w1, wt, new List<ArbiterWaypoint>());
 }
Exemplo n.º 40
0
 public Waypoint(Vector2 node, WaypointType type, float waitTime)
 {
     Node = node;
     Type = type;
     WaitTime = waitTime;
 }
 /// <summary>
 /// Type off a waypoint
 /// </summary>
 /// <param name="wt"></param>
 /// <returns></returns>
 public bool WaypointTypeEquals(WaypointType wt)
 {
     if (wt == WaypointType.End)
     {
         return this.NextPartition == null ? true : false;
     }
     else if (wt == WaypointType.Entry)
     {
         return this.isEntry;
     }
     else if (wt == WaypointType.Exit)
     {
         return this.isExit;
     }
     else if (wt == WaypointType.Stop)
     {
         return this.IsStop;
     }
     else
         return this.PreviousPartition == null;
 }
Exemplo n.º 42
0
 public Waypoint(WaypointType Type, string LabelName)
 {
     wType = Type;
     wLabelName = LabelName;
 }
 /// <summary>
 /// Get the next waypoint of a certain type
 /// </summary>
 /// <param name="loc">Location to start looking from</param>
 /// <param name="wt">Waypoint type to look for</param>
 /// <param name="ignorable">ignorable waypoints</param>
 /// <returns></returns>
 public ArbiterWaypoint GetNext(Coordinates loc, WaypointType wt, List<ArbiterWaypoint> ignorable)
 {
     return this.GetNext(this.GetClosestPartition(loc).Final, wt, ignorable);
 }
Exemplo n.º 44
0
 public Waypoint(WaypointType waypointType, Location location, string action)
 {
     _waypointType = waypointType;
     _location = location;
     _action = action;
 }
Exemplo n.º 45
0
 public Waypoint(WaypointType Type, int SleepTime1, int SleepTime2)
 {
     wType = Type;
     wSleepTime1 = SleepTime1;
     wSleepTime2 = SleepTime2;
 }
Exemplo n.º 46
0
 public Waypoint(WaypointType Type, Location Location)
 {
     wType = Type;
     wLocation = Location;
 }
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="loc">Location to start looking from</param>
        /// <param name="wt">Waypoint type to look for</param>
        /// <param name="ignorable">ignorable waypoints</param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(Coordinates loc, WaypointType wt, List<ArbiterWaypoint> ignorable)
        {
            List<WaypointType> wts = new List<WaypointType>();
            wts.Add(wt);

            SLComponentType closest = this.ClosestComponent(loc);
            if (closest == SLComponentType.Initial)
                return this.GetNext(this.Initial.GetClosestPartition(loc).Final, wts, ignorable);
            else if (closest == SLComponentType.Final)
                return this.GetNext(this.Final.GetClosestPartition(loc).Final, wts, ignorable);
            else
                return this.GetNext(this.Final.GetClosestPartition(loc).Final, wts, ignorable);
        }
Exemplo n.º 48
0
 public Waypoint(WaypointType Type)
 {
     wType = Type;
 }
Exemplo n.º 49
0
 public Waypoint(int waypointID, WaypointType waypointType, Location location, string action)
 {
     _waypointId = waypointID;
     _waypointType = waypointType;
     _location = location;
     _action = action;
 }
Exemplo n.º 50
0
        public DisplayWaypoint(Serial serial, int x, int y, int z, int mapID, /*int type*/WaypointType type, string name)
            : base(0xE5)
        {
            this.EnsureCapacity(25);

            m_Stream.Write((int)serial);

            m_Stream.Write((short)x);
            m_Stream.Write((short)y);
            m_Stream.Write((sbyte)z);
            m_Stream.Write((byte)mapID); //map 

            m_Stream.Write((ushort)type);
            //m_Stream.Write((short)type); //type 

            m_Stream.Write((short)0);

            if (type.Equals(1))
                m_Stream.Write((int)1046414);
            else
                m_Stream.Write((int)1062613);

            m_Stream.WriteLittleUniNull(name);

            m_Stream.Write((short)0); // terminate 
        }
Exemplo n.º 51
0
 public Waypoint(WaypointType Type, SayType SayType, string TextToSay)
 {
     wType = Type;
     wSayType = SayType;
     wTextToSay = TextToSay;
 }
Exemplo n.º 52
0
 public KRDisplayWaypoint(IEntity e, WaypointType type, int cliLoc)
     : this(e.Serial, e.Location, e.Map, type, false, cliLoc, String.Empty)
 {
 }
Exemplo n.º 53
0
 public Waypoint(WaypointType Type, uint ItemID)
 {
     wType = Type;
     wItemID = ItemID;
 }
Exemplo n.º 54
0
 public KRDisplayWaypoint(IEntity e, WaypointType type, bool ignoreSerial, int cliLoc, string args)
     : this(e.Serial, e.Location, e.Map, type, ignoreSerial, cliLoc, args)
 {
 }
Exemplo n.º 55
0
 /// <summary>
 /// Criando o waypoint.
 /// </summary>
 public Waypoint(int pId, GameObject pObject, WaypointType pType)
     : base(pId, pObject)
 {
     this._type = pType;
 }
Exemplo n.º 56
0
 public KRDisplayWaypoint(Serial serial, IPoint3D location, Map map, WaypointType type, bool ignoreSerial, int cliLoc)
     : this(serial, location, map, type, ignoreSerial, cliLoc, String.Empty)
 {
 }
Exemplo n.º 57
0
        public KRDisplayWaypoint(Serial serial, IPoint3D location, Map map, WaypointType type, bool ignoreSerial, int cliLoc, string args)
            : base(0xE5)
        {
            if (args == null)
                args = String.Empty;

            EnsureCapacity(21 + (args.Length * 2));

            m_Stream.Write((int)serial);

            m_Stream.Write((ushort)location.X);
            m_Stream.Write((ushort)location.Y);
            m_Stream.Write((byte)location.Z);

            m_Stream.Write((byte)map.MapID);

            m_Stream.Write((ushort)type);

            m_Stream.Write((ushort)(ignoreSerial ? 1 : 0));

            m_Stream.Write(cliLoc);
            m_Stream.WriteLittleUniNull(args);
        }
 /// <summary>
 /// Get the next waypoint of a certain type
 /// </summary>
 /// <param name="w1"></param>
 /// <param name="wt"></param>
 /// <param name="ignorable"></param>
 /// <returns></returns>
 public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt, List<ArbiterWaypoint> ignorable)
 {
     List<WaypointType> wts = new List<WaypointType>();
     wts.Add(wt);
     return this.GetNext(w1, wts, ignorable);
 }
Exemplo n.º 59
0
    protected override void OnNextWaypoint()
    {
        if (previousWaypoint != null && currentWaypoint != null)
        {
            WaypointType wptypeFrom = previousWaypoint.GetComponent <WaypointType>();
            WaypointType wptypeTo   = currentWaypoint.GetComponent <WaypointType>();
            if (wptypeFrom != null)
            {
                switch (wptypeFrom.Value)
                {
                case WaypointType.WPType.Null:
                    speedMod = FromModifiers.NullMod;
                    break;

                case WaypointType.WPType.Grass:
                    speedMod = FromModifiers.GrassMod;
                    break;

                case WaypointType.WPType.Water:
                    speedMod = FromModifiers.WaterMod;
                    break;

                case WaypointType.WPType.Sand:
                    speedMod = FromModifiers.SandMod;
                    break;

                case WaypointType.WPType.Snow:
                    speedMod = FromModifiers.SnowMod;
                    break;

                case WaypointType.WPType.Mountain:
                    speedMod = FromModifiers.MountainMod;
                    break;

                case WaypointType.WPType.Bridge:
                    speedMod = FromModifiers.BridgeMod;
                    break;

                case WaypointType.WPType.Town:
                    speedMod = FromModifiers.TownMod;
                    break;
                }
            }
            else
            {
                speedMod = 1.0f;
            }
            if (wptypeTo != null)
            {
                switch (wptypeTo.Value)
                {
                case WaypointType.WPType.Null:
                    speedMod *= ToModifiers.NullMod;
                    break;

                case WaypointType.WPType.Grass:
                    speedMod *= ToModifiers.GrassMod;
                    break;

                case WaypointType.WPType.Water:
                    speedMod *= ToModifiers.WaterMod;
                    break;

                case WaypointType.WPType.Sand:
                    speedMod *= ToModifiers.SandMod;
                    break;

                case WaypointType.WPType.Snow:
                    speedMod *= ToModifiers.SnowMod;
                    break;

                case WaypointType.WPType.Mountain:
                    speedMod *= ToModifiers.MountainMod;
                    break;

                case WaypointType.WPType.Bridge:
                    speedMod *= ToModifiers.BridgeMod;
                    break;

                case WaypointType.WPType.Town:
                    speedMod *= ToModifiers.TownMod;
                    break;
                }
            }
        }
    }
        /// <summary>
        /// Get the next waypoint of a certain type
        /// </summary>
        /// <param name="w1">Starting waypoint of search</param>
        /// <param name="wt">Waypoint type to look for</param>
        /// <returns></returns>
        public ArbiterWaypoint GetNext(ArbiterWaypoint w1, WaypointType wt)
        {
            ArbiterWaypoint tmp = w1;
            while (tmp != null)
            {
                if (tmp.WaypointTypeEquals(wt))
                    return tmp;

                if (tmp.NextPartition != null)
                    tmp = tmp.NextPartition.Final;
                else
                    tmp = null;
            }

            return null;
        }