示例#1
0
        public HttpResponseMessage SaveProjectFisherman(JObject jsonData)
        {
            var     db      = ServicesContext.Current;
            dynamic json    = jsonData;
            User    me      = AuthorizationManager.getCurrentUser();
            Project project = db.Projects.Find(json.ProjectId.ToObject <int>());

            if (!project.isOwnerOrEditor(me))
            {
                logger.Debug("User is not authorized to make this update.");
                throw new System.Exception("Authorization error.");
            }

            Fisherman fisherman = db.Fishermen.Find(json.Fisherman.Id.ToObject <int>());

            if (project == null || fisherman == null)
            {
                throw new System.Exception("Configuration error.  Please try again.");
            }

            project.Fishermen.Add(fisherman);
            db.SaveChanges();
            logger.Debug("success adding NEW project fisherman!");


            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
示例#2
0
        public HttpResponseMessage RemoveProjectFisherman(JObject jsonData)
        {
            var     db   = ServicesContext.Current;
            dynamic json = jsonData;
            User    me   = AuthorizationManager.getCurrentUser();
            Project p    = db.Projects.Find(json.ProjectId.ToObject <int>());

            if (!p.isOwnerOrEditor(me))
            {
                throw new System.Exception("Authorization error.");
            }

            Fisherman fisherman = db.Fishermen.Find(json.FishermanId.ToObject <int>());

            if (p == null || fisherman == null)
            {
                throw new System.Exception("Configuration error.  Please try again.");
            }

            p.Fishermen.Remove(fisherman);
            db.Entry(p).State = EntityState.Modified;
            db.SaveChanges();

            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
示例#3
0
        public HttpResponseMessage SaveFisherman(JObject jsonData)
        {
            var db = ServicesContext.Current;

            dynamic json = jsonData;

            User me = AuthorizationManager.getCurrentUser();

            int pId = json.ProjectId.ToObject <int>(); // Getting stuck on this line.

            Project p = db.Projects.Find(pId);

            if (p == null)
            {
                throw new System.Exception("Configuration error.  Please try again.");
            }

            if (!p.isOwnerOrEditor(me))
            {
                throw new System.Exception("Authorization error.");
            }

            Fisherman f = json.Fisherman.ToObject <Fisherman>();

            DateTime?theDateInactive = null;

            f.DateInactive = theDateInactive;

            logger.Debug(
                "f.FirstName = " + f.FirstName + "\n" +
                "f.Aka = " + f.Aka + "\n" +
                "f.LastName = " + f.LastName + "\n" +
                "f.FullName = " + f.LastName + "\n" +
                "f.PhoneNumber = " + f.PhoneNumber + "\n" +
                "f.Comments = " + f.FishermanComments + "\n" +
                "f.StatusId = " + f.StatusId + "\n" +
                "f.DateAdded = " + f.DateAdded + "\n" +
                "f.DateInactive = " + f.DateInactive + "\n" +
                "f.OkToCallId = " + f.OkToCallId + "\n"
                );

            if (f.Id == 0)
            {
                p.Fishermen.Add(f);
                logger.Debug("created new fisherman");
            }
            else
            {
                db.Entry(f).State = EntityState.Modified;
                logger.Debug("updated existing fisherman");
            }

            db.SaveChanges();
            logger.Debug("Just saved the DB changes.");

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, f);

            return(response);
        }
示例#4
0
    public override void Enter(FishController fish)
    {
        Fisherman fisherman = fish.target.GetComponent <AIMovement>().target.GetComponent <Fisherman>();

        fisherman.fishOnHook = fish;
        fisherman.SetState(new HookedState());
        fisherman.GetState().Enter(fish.target.GetComponent <AIMovement>().target.GetComponent <Fisherman>());
        Debug.Log("Caught!");
    }
示例#5
0
    public override PlayerState Update(Fisherman player)
    {
        if (Input.GetKey(KeyCode.X))
        {
            bool cast = player.CastLure();
            if (cast)
            {
                return(new WaitingState());
            }
            else
            {
                return(null);
            }
        }

        return(null);
    }
示例#6
0
    public override PlayerState Update(Fisherman player)
    {
        if (Input.GetButton("Action"))
        {
            player.lure.GetComponent <AIMovement>().target   = player.gameObject;
            player.lure.GetComponent <AIMovement>().movement = AIMovement.Movement.Arrive;
        }
        else if (player.lure.GetComponent <AIMovement>().velocity.magnitude > player.lure.GetComponent <AIMovement>().minSpeed)
        {
            player.lure.GetComponent <AIMovement>().movement = AIMovement.Movement.Stop;
        }
        else
        {
            player.lure.GetComponent <AIMovement>().velocity = Vector3.zero;
            player.lure.GetComponent <AIMovement>().target   = player.gameObject;
            player.lure.GetComponent <AIMovement>().movement = AIMovement.Movement.Face;
        }

        return(null);
    }
示例#7
0
        public static void TestaaKalat()
        {
            try
            {
                Fisherman kalamies = new Fisherman("Kirsi Kernel", "0700666123");

                kalamies.Kalat.Add(new Fish("Siika", "40cm", 2, "Kuralampi", "Jyväskylä"));
                kalamies.Kalat.Add(new Fish("Hauki", "52cm", 5, "Pielisjoki", "Joensuu"));
                kalamies.Kalat.Add(new Fish("Sinivalas", "23m", 100000, "Rekilampi", "Kulho"));

                Console.WriteLine(kalamies.ToString());

                Console.WriteLine("Sorttia::::");
                kalamies.Kalat.Sort((x, y) => y.Paino.CompareTo(x.Paino));
                foreach (var item in kalamies.Kalat)
                {
                    Console.WriteLine(item);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#8
0
        public static void show()
        {
            List <Fisherman> listFisherman = new List <Fisherman>();
            Fisherman        fisherman1    = new Fisherman()
            {
                ID = 1, Name = "roy", Description = "我是一个初级入门钓者", Leavel = 1
            };

            listFisherman.Add(fisherman1);
            Fisherman fisherman2 = new Fisherman()
            {
                ID = 1, Name = "better roy", Description = "我是一个中级入门钓者", Leavel = 2
            };

            listFisherman.Add(fisherman2);
            fisherman1.EatFish();


            Console.WriteLine("************************normal 扩展方法************************");
            List <Fisherman> fishermen1 = listFisherman.FishermenWhere();

            Console.WriteLine("************************normal 扩展方法************************");
            Console.WriteLine();

            Console.WriteLine("************************Func 扩展方法************************");
            List <Fisherman> fishermen2 = listFisherman.FishermenWhere(item => item.Leavel > 1);

            Console.WriteLine("************************Func 扩展方法************************");
            Console.WriteLine();

            Console.WriteLine("************************Linq 扩展方法************************");
            List <Fisherman> fishermen3 = listFisherman.ListWhereByRoy <Fisherman>(item => item.Leavel > 1);

            Console.WriteLine("************************Linq 扩展方法************************");
            Console.WriteLine();
        }
示例#9
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            base.OnMovement(m, oldLocation);


            int hours, minutes, uoDay, totalUoDays, totalMinutes;

            Server.Items.Clock.GetTime(m.Map, m.X, m.Y, out hours, out minutes, out totalMinutes);

            totalUoDays = (int)Math.Ceiling((double)totalMinutes / (60 * 24));

            Math.DivRem(totalUoDays, 30, out uoDay);

            //if (uoDay== 1 || uoDay == 7 || uoDay == 15 || uoDay== 23)
            // {
            if (hours >= 6 && hours <= 18)
            {
                int marketplace    = m_market.Count;
                int marketplacemob = m_marketmob.Count;

                if (marketplace >= marketCount && marketplacemob >= marketCount)
                {
                    return;
                }

                bool validLocation = false;
                Map  map           = this.Map;

                for (int i = marketplace; i < marketCount; ++i)
                {
                    if (i == 0)
                    {
                        Point3D marketloc = this.Location;//
                        AG_MarketStandMercerEastAddon market = new AG_MarketStandMercerEastAddon();

                        for (int k = 0; !validLocation && k < 10; ++k)
                        {
                            int ax = X;
                            int ay = Y + 3;
                            int az = map.GetAverageZ(ax, ay);

                            if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                            {
                                marketloc = new Point3D(ax, ay, Z);
                            }
                            else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                            {
                                marketloc = new Point3D(ax, ay, az);
                            }
                        }
                        market.MoveToWorld(marketloc, this.Map);
                        m_market.Add(market);
                    }

                    if (i == 1)
                    {
                        Point3D marketloc1 = this.Location;//
                        AG_MarketStandCheeseSouthAddon market = new AG_MarketStandCheeseSouthAddon();

                        int bx = X - 3;
                        int by = Y;
                        int bz = map.GetAverageZ(bx, by);

                        if (validLocation = map.CanFit(bx, by, this.Z, 16, false, false))
                        {
                            marketloc1 = new Point3D(bx, by, Z);
                        }
                        else if (validLocation = map.CanFit(bx, by, bz, 16, false, false))
                        {
                            marketloc1 = new Point3D(bx, by, bz);
                        }

                        market.MoveToWorld(marketloc1, this.Map);
                        m_market.Add(market);
                    }

                    if (i == 2)
                    {
                        Point3D marketloc2 = this.Location;//
                        MarketStandVegetablesSouthAddon market = new MarketStandVegetablesSouthAddon();

                        int cx = X + 3;
                        int cy = Y;
                        int cz = map.GetAverageZ(cx, cy);

                        if (validLocation = map.CanFit(cx, cy, this.Z, 16, false, false))
                        {
                            marketloc2 = new Point3D(cx, cy, Z);
                        }
                        else if (validLocation = map.CanFit(cx, cy, cz, 16, false, false))
                        {
                            marketloc2 = new Point3D(cx, cy, cz);
                        }

                        market.MoveToWorld(marketloc2, this.Map);
                        m_market.Add(market);
                    }

                    if (i == 3)
                    {
                        Point3D marketloc3 = this.Location;//
                        AG_MarketStandFishEastAddon market = new AG_MarketStandFishEastAddon();

                        int dx = X;
                        int dy = Y - 3;
                        int dz = map.GetAverageZ(dx, dy);

                        if (validLocation = map.CanFit(dx, dy, this.Z, 16, false, false))
                        {
                            marketloc3 = new Point3D(dx, dy, Z);
                        }
                        else if (validLocation = map.CanFit(dx, dy, dz, 16, false, false))
                        {
                            marketloc3 = new Point3D(dx, dy, dz);
                        }

                        market.MoveToWorld(marketloc3, this.Map);
                        m_market.Add(market);
                    }
                }

                for (int i = marketplacemob; i < marketmobCount; ++i)
                {
                    if (i == 0)
                    {
                        Point3D         marketloc5 = this.Location;//
                        VegetableFarmer marketmob0 = new VegetableFarmer();

                        int fx = X + 3;
                        int fy = Y;
                        int fz = map.GetAverageZ(fx, fy);

                        if (validLocation = map.CanFit(fx, fy, this.Z, 16, false, false))
                        {
                            marketloc5 = new Point3D(fx, fy, Z);
                        }
                        else if (validLocation = map.CanFit(fx, fy, fz, 16, false, false))
                        {
                            marketloc5 = new Point3D(fx, fy, fz);
                        }

                        marketmob0.Home      = marketloc5;
                        marketmob0.RangeHome = 0;
                        marketmob0.MoveToWorld(marketloc5, this.Map);
                        m_marketmob.Add(marketmob0);
                    }
                    if (i == 1)
                    {
                        Point3D marketloc6 = this.Location;//
                        Mercer  marketmob1 = new Mercer();

                        int gx = X - 2;
                        int gy = Y + 3;
                        int gz = map.GetAverageZ(gx, gy);

                        if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                        {
                            marketloc6 = new Point3D(gx, gy, Z);
                        }
                        else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                        {
                            marketloc6 = new Point3D(gx, gy, gz);
                        }

                        marketmob1.Home      = marketloc6;
                        marketmob1.RangeHome = 0;
                        marketmob1.MoveToWorld(marketloc6, this.Map);
                        m_marketmob.Add(marketmob1);
                    }
                    if (i == 2)
                    {
                        Point3D   marketloc7 = this.Location; //
                        Fisherman marketmob2 = new Fisherman();

                        int hx = X + 3;
                        int hy = Y - 3;
                        int hz = map.GetAverageZ(hx, hy);

                        if (validLocation = map.CanFit(hx, hy, this.Z, 16, false, false))
                        {
                            marketloc7 = new Point3D(hx, hy, Z);
                        }
                        else if (validLocation = map.CanFit(hx, hy, hz, 16, false, false))
                        {
                            marketloc7 = new Point3D(hx, hy, hz);
                        }

                        marketmob2.Home      = marketloc7;
                        marketmob2.RangeHome = 0;
                        marketmob2.MoveToWorld(marketloc7, this.Map);
                        m_marketmob.Add(marketmob2);
                    }
                    if (i == 3)
                    {
                        Point3D      marketloc8 = this.Location; //
                        CheeseMonger marketmob3 = new CheeseMonger();

                        int ix = X - 3;
                        int iy = Y - 2;
                        int iz = map.GetAverageZ(ix, iy);

                        if (validLocation = map.CanFit(ix, iy, this.Z, 16, false, false))
                        {
                            marketloc8 = new Point3D(ix, iy, Z);
                        }
                        else if (validLocation = map.CanFit(ix, iy, iz, 16, false, false))
                        {
                            marketloc8 = new Point3D(ix, iy, iz);
                        }

                        marketmob3.Home      = marketloc8;
                        marketmob3.RangeHome = 0;
                        marketmob3.MoveToWorld(marketloc8, this.Map);
                        m_marketmob.Add(marketmob3);
                    }
                }
            }
            //}

            else
            {
                foreach (Item that in m_market)
                {
                    that.Delete();
                }

                foreach (Mobile thats in m_marketmob)
                {
                    thats.Delete();
                }
            }
        }
示例#10
0
 public override PlayerState HandleInput(Fisherman player, Input input)
 {
     return(null);
 }
示例#11
0
 public override void Exit(Fisherman player)
 {
 }
示例#12
0
 public override void Enter(Fisherman player)
 {
     player.lure.GetComponent <AIMovement>().maxSpeed = 1;
 }
示例#13
0
 public static void EatFish(this Fisherman fisherman)
 {
     Console.WriteLine($"That is a Extension Method.I'm a fisherman,I'm eating fish right now.{fisherman.Name}");
 }
示例#14
0
 public void SetPlayer(Fisherman player)
 {
     this.player      = player;
     this.catchRadius = player.catchRadius;
 }
示例#15
0
 public abstract PlayerState HandleInput(Fisherman player, Input input);
示例#16
0
 public abstract PlayerState Update(Fisherman player);
示例#17
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            base.OnMovement(m, oldLocation);


            int hours, minutes, uoDay, totalUoDays, totalMinutes;

            Server.Items.Clock.GetTime(m.Map, m.X, m.Y, out hours, out minutes, out totalMinutes);

            totalUoDays = (int)Math.Ceiling((double)totalMinutes / (60 * 24));

            Math.DivRem(totalUoDays, 30, out uoDay);

            //if (uoDay== 1 || uoDay == 7 || uoDay == 15 || uoDay== 23)
            // {
            if (hours >= 6 && hours <= 20)
            {
                int marketplace    = m_market.Count;
                int marketplacemob = m_marketmob.Count;

                if (marketplace >= marketCount && marketplacemob >= marketCount)
                {
                    return;
                }

                bool validLocation = false;
                Map  map           = this.Map;

                switch (Utility.Random(11))
                {
                    #region fisherman
                case 0:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandFishEastAddon market = new MarketStandFishEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;
                            Fisherman marketmob1 = new Fisherman();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region mercer
                case 1:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandMercerEastAddon market = new MarketStandMercerEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc6 = this.Location;        //
                            Tailor  marketmob1 = new Tailor();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region vegetables
                case 2:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandVegetablesEastAddon market = new MarketStandVegetablesEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc6 = this.Location;        //
                            Farmer  marketmob1 = new Farmer();

                            int gx = X - 2;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region cheese
                case 3:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandCheeseEastAddon market = new MarketStandCheeseEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc6 = this.Location;        //
                            Farmer  marketmob1 = new Farmer();

                            int gx = X - 1;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region wine
                case 4:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandWineEastAddon market = new MarketStandWineEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y - 1;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;      //
                            Barkeeper marketmob1 = new Barkeeper();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region herbs
                case 5:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandHerbsEastAddon market = new MarketStandHerbsEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;      //
                            Herbalist marketmob1 = new Herbalist();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region mushroom
                case 6:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandMushroomEastAddon market = new MarketStandMushroomEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;      //
                            Herbalist marketmob1 = new Herbalist();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region fur
                case 7:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandFurEastAddon market = new MarketStandFurEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;      //
                            Furtrader marketmob1 = new Furtrader();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region bee
                case 8:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandBeeEastAddon market = new MarketStandBeeEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D   marketloc6 = this.Location;      //
                            Beekeeper marketmob1 = new Beekeeper();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region copper
                case 9:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandCopperEastAddon market = new MarketStandCopperEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D    marketloc6 = this.Location;     //
                            Blacksmith marketmob1 = new Blacksmith();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion

                    #region tool
                case 10:
                {
                    for (int i = marketplace; i < marketCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc = this.Location;        //
                            MarketStandToolEastAddon market = new MarketStandToolEastAddon();

                            for (int k = 0; !validLocation && k < 10; ++k)
                            {
                                int ax = X;
                                int ay = Y;
                                int az = map.GetAverageZ(ax, ay);

                                if (validLocation = map.CanFit(ax, ay, this.Z, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, Z);
                                }
                                else if (validLocation = map.CanFit(ax, ay, az, 16, false, false))
                                {
                                    marketloc = new Point3D(ax, ay, az);
                                }
                            }
                            market.MoveToWorld(marketloc, this.Map);
                            m_market.Add(market);
                        }
                    }
                    for (int i = marketplacemob; i < marketmobCount; ++i)
                    {
                        if (i == 0)
                        {
                            Point3D marketloc6 = this.Location;        //
                            Tinker  marketmob1 = new Tinker();

                            int gx = X + 3;
                            int gy = Y;
                            int gz = map.GetAverageZ(gx, gy);

                            if (validLocation = map.CanFit(gx, gy, this.Z, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, Z);
                            }
                            else if (validLocation = map.CanFit(gx, gy, gz, 16, false, false))
                            {
                                marketloc6 = new Point3D(gx, gy, gz);
                            }

                            marketmob1.Home      = marketloc6;
                            marketmob1.RangeHome = 0;
                            marketmob1.MoveToWorld(marketloc6, this.Map);
                            m_marketmob.Add(marketmob1);
                        }
                    }
                    break;
                }

                    #endregion
                }
            }

            else
            {
                foreach (Item that in m_market)
                {
                    that.Delete();
                }

                foreach (Mobile thats in m_marketmob)
                {
                    thats.Delete();
                }
            }
        }
示例#18
0
 public override void Enter(Fisherman player)
 {
     player.RemoveLure();
 }
示例#19
0
 public abstract void Enter(Fisherman player);
示例#20
0
 public abstract void Exit(Fisherman player);