Пример #1
0
 public CulinaryMajor()
 {
     health       = 22; maxHP = 22; strength = 3; power = 0; charge = 0; defense = 0; guard = 0;
     baseAccuracy = 12; accuracy = 12; dexterity = 2; evasion = 0; type = "Culinary Major"; passive = new Cooking(this);
     quirk        = Quirk.GetQuirk(this); special2 = new Feast(); special = new SpicyEscape();
     player       = false; champion = false; recruitable = true; CreateDrops(); attackEffect = "recover from poison and goop";
 }
Пример #2
0
        public bool DeleteEntity(Feast feast)
        {
            if (ReadOnly)
            {
                return(false);
            }

            Feast f = feast;

            if (f == null || f.FeastDate < DateTime.Now.Date) // || UCCountryEdit.IsEstimationExist(f.FeastDate, Country.ID)
            {
                return(false);
            }

            try
            {
                ClientEnvironment.FeastService.DeleteByID(f.ID);
                ListOfFeasts.Remove(f);
                UpdateEnableButton();
                return(true);
            }
            catch (Exception ex)
            {
                ErrorMessage(ex.Message);
                return(false);
            }
        }
Пример #3
0
        // Run the command.
        public void Execute(RocketPlayer caller, string[] command)
        {
            Utils.Respond(caller, "Resetting the feast.");
            Feast feast = Feast.Instance;

            feast.resetFeast();
        }
Пример #4
0
        // GET: RegistrationFeasts/Create
        //[Authorize(Roles = "admin")]
        public IActionResult Create(int id)
        {
            if (User.Identity.IsAuthenticated) //UnauthorizedResult
            {
                var FeastDbContext = _context.Feasts;
                foreach (Feast bufferFeast in FeastDbContext)
                {
                    if (bufferFeast.id == id)
                    {
                        ViewData["Url"] = bufferFeast.RediarectUrl;
                        CurrentFeast    = bufferFeast;
                        break;
                    }
                }

                ViewBag.Fid = id;
                ViewData["AspNetUserId"] = new SelectList(_context.AspNetUsers, "Id", "Id");
                ViewData["FeastId"]      = new SelectList(_context.Feasts, "id", "id");
                //ViewData["Topic"] = new SelectList(_context.Feasts, "Topic", "Topic");
                return(View());
            }
            else
            {
                return(Unauthorized());
            }
        }
Пример #5
0
        Feast GetEntityByRowHandle(int rowHandle)
        {
            Feast feast = null;

            if (gridViewFeast.IsDataRow(rowHandle))
            {
                feast = (Feast)gridViewFeast.GetRow(rowHandle);
            }
            return(feast);
        }
Пример #6
0
        public void Execute(RocketPlayer caller, string[] command)
        {
            Feast feast = Feast.Instance;


            if (command.Length > 2 || command.Length == 0)
            {
                // Not enough, or too many params.
                Utils.Respond(caller, "Wrong usage of command setfeast.");
            }
            else if (command.Length == 2)
            {
                // Two params. Is one of them f?
                if (command[1] != "f" && command[0] != "f")
                {
                    // Nope, that's no good.
                    Utils.Respond(caller, "Wrong usage of command setfeast.");
                }
                else
                {
                    string location  = (command[0] == "f") ? command[1] : command[0];
                    loc    locReturn = CheckLoc(location);
                    if (locReturn.isMapLocation)
                    {
                        Utils.Respond(caller, "Forcing feast location of " + location + ".");
                        feast.setNextLocation(locReturn.listLoc);
                    }
                    else
                    {
                        Utils.Respond(caller, "Location not on map.");
                    }
                }
            }
            else
            {
                // One parameter.
                string location  = command[0];
                loc    locReturn = CheckLoc(location);
                if (locReturn.isLocation)
                {
                    Utils.Respond(caller, "Setting the feast to " + locReturn.listLoc.Name());
                    feast.setNextLocation(locReturn.listLoc);
                }
                else
                if (locReturn.isMapLocation)
                {
                    Utils.Respond(caller, "Location not a part of Feast locations. Use f parameter to force.");
                }
                else
                {
                    Utils.Respond(caller, "Location not on map.");
                }
            }
        }
Пример #7
0
        public loc CheckLoc(string location_name)
        {
            Feast feast = Feast.Instance;

            Locs locResultObj = feast.getLocations().FirstOrDefault(a => a.Name() == location_name);
            Locs mapResultObj = feast.getMapLocations().FirstOrDefault(b => b.Name() == location_name);

            bool locResult = (locResultObj != null);
            bool mapResult = (mapResultObj != null);

            return(new loc(locResult, mapResult, mapResultObj));
        }
Пример #8
0
        private void dateNavigator1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            DateTime dt = dateNavigator1.DateTime;

            Feast feast = new Feast();

            feast.Country = Country;
            feast.Date    = dt;
            _bindingFeasts.Add(feast);

            Modified = true;
        }
Пример #9
0
        public Feast FeastExists(long countryid, DateTime date)
        {
            CountryFeastListEx item = this[countryid];
            Feast feast             = null;

            if (item != null)
            {
                item.TryGetValue(date, out feast);
            }

            return(feast);
        }
Пример #10
0
 private void gridViewFeast_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
 {
     if (e.Column == gc_DayOfWeek)
     {
         if (e.IsGetData)
         {
             int idx = e.ListSourceRowIndex;
             if (idx >= 0 && idx < ListOfFeasts.Count)
             {
                 Feast feast = ListOfFeasts[e.ListSourceRowIndex];
                 e.Value = m_weekDays[(int)feast.FeastDate.DayOfWeek];
             }
         }
     }
 }
Пример #11
0
        public void Run(SparseMatrix A, int m, bool symmetric)
        {
            var solver = new Feast(A);

            //solver.Options.PrintStatus = true;

            // The current version of MKL (2018.1) uses FEAST 2.0. One of the difficulties is
            // to guess a correct size for the initial subspace dimension, so all eigenvalues
            // of the requested interval can be computed (the latest version of  FEAST offers
            // a method to estimate the number of eigenvalues inside of the search interval).

            var timer = Stopwatch.StartNew();

            var result = solver.SolveStandard(m, 0.0, 0.1); // interval [0.0, 0.2] would fail

            timer.Stop();

            Display.Time(timer.ElapsedTicks);

            if (result.RelativeTraceError > ERROR_THRESHOLD)
            {
                Display.Warning("relative error too large");
            }
            else if (result.Status == 3)
            {
                // If the subspace guess is too small, status will be 3 and either
                // the dimension must be increased or the search interval reduced.
                Display.Warning("subspace size too small");
            }
            else if (result.Status == 0)
            {
                if (CheckResiduals(A, result, false))
                {
                    Display.Ok("OK");
                }
                else
                {
                    Display.Warning("residual error too large");
                }
            }
            else
            {
                Display.Warning("status = " + result.Status);
            }
        }
Пример #12
0
        void DeleteFeast(Feast feast)
        {
            if (ReadOnly)
            {
                return;
            }

            Feast f = feast;

            if (f == null)
            {
                f = FocusedFeast;
            }

            if (f == null)
            {
                return;
            }

            _bindingFeast.Remove(f);
        }
Пример #13
0
        // BASE
        static PresetGames()
        {
            games.Add(Games.AllCards1stEdition, new List <Card>
            {
                Adventurer.Get(),
                Bureaucrat.Get(),
                Cellar.Get(),
                CouncilRoom.Get(),
                Feast.Get(),
                Festival.Get(),
                Gardens.Get(),
                Chancellor.Get(),
                Chapel.Get(),
                Laboratory.Get(),
                Library.Get(),
                Market.Get(),
                Militia.Get(),
                Mine.Get(),
                Moat.Get(),
                Moneylender.Get(),
                Remodel.Get(),
                Smithy.Get(),
                Spy.Get(),
                Thief.Get(),
                ThroneRoom.Get(),
                Village.Get(),
                Witch.Get(),
                Woodcutter.Get(),
                Workshop.Get(),
            });

            games.Add(Games.FirstGame, new List <Card>
            {
                Cellar.Get(),
                Moat.Get(),
                Village.Get(),
                Woodcutter.Get(),
                Workshop.Get(),
                Militia.Get(),
                Remodel.Get(),
                Smithy.Get(),
                Market.Get(),
                Mine.Get(),
            });

            games.Add(Games.BigMoney, new List <Card>
            {
                Adventurer.Get(),
                Bureaucrat.Get(),
                Chancellor.Get(),
                Chapel.Get(),
                Feast.Get(),
                Laboratory.Get(),
                Market.Get(),
                Mine.Get(),
                Moneylender.Get(),
                ThroneRoom.Get(),
            });

            games.Add(Games.Interaction, new List <Card>
            {
                Bureaucrat.Get(),
                Chancellor.Get(),
                CouncilRoom.Get(),
                Festival.Get(),
                Library.Get(),
                Militia.Get(),
                Moat.Get(),
                Spy.Get(),
                Thief.Get(),
                Village.Get()
            });

            games.Add(Games.SizeDistortion, new List <Card>
            {
                Cellar.Get(),
                Chapel.Get(),
                Feast.Get(),
                Gardens.Get(),
                Laboratory.Get(),
                Thief.Get(),
                Village.Get(),
                Witch.Get(),
                Woodcutter.Get(),
                Workshop.Get(),
            });

            games.Add(Games.VillageSquare, new List <Card>
            {
                Bureaucrat.Get(),
                Cellar.Get(),
                Festival.Get(),
                Library.Get(),
                Market.Get(),
                Remodel.Get(),
                Smithy.Get(),
                ThroneRoom.Get(),
                Village.Get(),
                Woodcutter.Get(),
            });

            games.Add(Games.ThrashHeap, new List <Card>
            {
                Chapel.Get(),
                Village.Get(),
                Workshop.Get(),
                Woodcutter.Get(),
                Feast.Get(),
                Moneylender.Get(),
                Remodel.Get(),
                Mine.Get(),
                Festival.Get(),
                Market.Get(),
            });
        }
Пример #14
0
        /// <summary>
        /// Creates a new card based on how many cards have already been made.
        /// </summary>
        /// <param name="card">
        /// The name of the card to be created.
        /// </param>
        /// <returns>
        /// The new created card.
        /// </returns>
        public static Card CreateCard(CardName card)
        {
            Contract.Requires(card != CardName.Backside & card != CardName.Empty);

            Contract.Ensures(Contract.Result<Card>().Name == card);

            Card c;
            switch (card)
            {
                case CardName.Copper:
                    c = new Copper();
                    break;
                case CardName.Silver:
                    c = new Silver();
                    break;
                case CardName.Gold:
                    c = new Gold();
                    break;
                case CardName.Curse:
                    c = new Curse();
                    break;
                case CardName.Estate:
                    c = new Estate();
                    break;
                case CardName.Duchy:
                    c = new Duchy();
                    break;
                case CardName.Province:
                    c = new Province();
                    break;
                case CardName.Gardens:
                    c = new Gardens();
                    break;
                case CardName.Cellar:
                    c = new Cellar();
                    break;
                case CardName.Chapel:
                    c = new Chapel();
                    break;
                case CardName.Chancellor:
                    c = new Chancellor();
                    break;
                case CardName.Village:
                    c = new Village();
                    break;
                case CardName.Woodcutter:
                    c = new Woodcutter();
                    break;
                case CardName.Workshop:
                    c = new Workshop();
                    break;
                case CardName.Feast:
                    c = new Feast();
                    break;
                case CardName.Moneylender:
                    c = new Moneylender();
                    break;
                case CardName.Remodel:
                    c = new Remodel();
                    break;
                case CardName.Smithy:
                    c = new Smithy();
                    break;
                case CardName.ThroneRoom:
                    c = new ThroneRoom();
                    break;
                case CardName.CouncilRoom:
                    c = new CouncilRoom();
                    break;
                case CardName.Festival:
                    c = new Festival();
                    break;
                case CardName.Laboratory:
                    c = new Laboratory();
                    break;
                case CardName.Library:
                    c = new Library();
                    break;
                case CardName.Market:
                    c = new Market();
                    break;
                case CardName.Mine:
                    c = new Mine();
                    break;
                case CardName.Adventurer:
                    c = new Adventurer();
                    break;
                case CardName.Bureaucrat:
                    c = new Bureaucrat();
                    break;
                case CardName.Militia:
                    c = new Militia();
                    break;
                case CardName.Spy:
                    c = new Spy();
                    break;
                case CardName.Thief:
                    c = new Thief();
                    break;
                case CardName.Witch:
                    c = new Witch();
                    break;
                case CardName.Moat:
                    c = new Moat();
                    break;
                default:
                    throw new NotImplementedException("Tried to create a card that was not implemented when CardFactory was last updated.");
            }

            c.Initialize(card, CardsMade[card]);
            CardsMade[card] += 1;
            createdCards.Add(c, true);
            return c;
        }
Пример #15
0
 public Task <Feast> DeleteAsync(Feast entity)
 {
     throw new NotImplementedException();
 }
Пример #16
0
 public Feast[] GetNewFeasts()
 {
     Feast[] _arr = new Feast[_bindingFeasts.Count];
     _bindingFeasts.CopyTo(_arr, 0);
     return(_arr);
 }