示例#1
0
 protected override void Unique(Donut interactor)
 {
     //Speed Boost
     SpEf.DonutBoost();
     //Destroy trigger but not visuals
     Destroy(this.GetComponent <BoxCollider>());
 }
        public async Task <IActionResult> Search(int id)

        {
            var model = new Donut();

            if (id > 0)
            {
                var client = new HttpClient();
                client.BaseAddress = new Uri(@"https://grandcircusco.github.io/");
                var response = await client.GetAsync($"demo-apis/donuts/{id}.json");

                response.EnsureSuccessStatusCode();
                var content = await response.Content.ReadAsStringAsync();

                var result = JsonConvert.DeserializeObject <JObject>(content);
                model.Id       = result["id"].ToObject <int>();
                model.Name     = result["name"].ToObject <string>();
                model.Calories = result["calories"].ToObject <int>();
                if (result["photo"] != null)
                {
                    model.PhotoURL = result["photo"].ToObject <string>();
                }
                if (result["extras"] != null)
                {
                    model.Extras = result["extras"].ToObject <string[]>();
                }
            }

            return(View(model));
        }
示例#3
0
        public ActionResult <Donut> CreateDonut(Donut donut)
        {
            _repository.CreateDonut(donut);
            _repository.SaveChanges();

            return(Ok(donut));
        }
示例#4
0
        public ActionResult BudgetAnnualChart()
        {
            var pf = new List <Donut>();

            foreach (var c in db.Categories)
            {
                var newDonut = new Donut();

                if (c.Occurance == "Monthly")
                {
                    var annualBudget = c.BudgetCost * 12;
                    newDonut.value = annualBudget.ToString();
                    newDonut.label = c.Type;
                    pf.Add(newDonut);
                }
                else
                {
                    var annualBudget = c.BudgetCost;
                    newDonut.value = annualBudget.ToString();
                    newDonut.label = c.Type;
                    pf.Add(newDonut);
                }
            }

            return(Json(pf, JsonRequestBehavior.AllowGet));
        }
示例#5
0
        public void GenarateData(DataContext data)
        {
            Donut d1 = new Donut("Toffee for your Coffee", 1, 8.9, DonutTypeEnum.Caramel);

            data.catalog.products.Add(1, d1);
            Donut d2 = new Donut("Jam-Packed", 2, 7.6, DonutTypeEnum.Jelly);

            data.catalog.products.Add(2, d2);
            Donut d3 = new Donut("I dream a Cream ", 3, 5.6, DonutTypeEnum.Vanilla);

            data.catalog.products.Add(3, d3);
            Donut d4 = new Donut("Big Apple", 4, 6.8, DonutTypeEnum.Apple);

            data.catalog.products.Add(4, d4);


            Customer c1 = new Customer("Ola", "Nowak", "O1");

            data.clients.Add(c1);
            Customer c2 = new Customer("Aleksandra", "Nowak", "A2");

            data.clients.Add(c2);
            Customer c3 = new Customer("Aleks", "Nowak", "A3");

            data.clients.Add(c3);

            data.shop.catalog = data.catalog;

            for (int i = 1; i <= data.catalog.products.Count; i++)
            {
                data.shop.inventory.Add(data.catalog.products[i].Id, 10);
            }
        }
示例#6
0
        static void Main(string[] args)
        {
            Donut PaulDonut = new Donut();
            Donut KennDonut = new Donut();
            Donut JayDonut  = new Donut();


            PaulDonut.Filling   = "Cherry Jelly";
            PaulDonut.Price     = 7.99M;
            PaulDonut.Type      = "Jelly";
            PaulDonut.IsSpecial = true;


            KennDonut.Filling   = "Strawberry Jelly";
            KennDonut.Price     = 0;
            KennDonut.Type      = "Jelly";
            KennDonut.IsSpecial = false;


            JayDonut.Filling   = "Creme";
            JayDonut.Price     = 3.50M;
            JayDonut.Type      = AngelCreme;
            JayDonut.IsSpecial = true;



            Console.WriteLine(PaulDonut);
            Console.WriteLine(PaulDonut.Filling);
        }
        void Start()
        {
            Person person = new Person();

            person.Name = "Bob";

            var apple = new Apple();

            person.Eat(apple);

            var cookie = new Cookie();

            person.Eat(cookie);

            var donut = new Donut();

            person.Eat(donut);

            var pancake = new Pancake();

            person.Eat(pancake);

            var sandwich = new Sandwich();

            person.Eat(sandwich);

            var steak = new Steak();

            person.Eat(steak);
        }
示例#8
0
        private void ConfigureChart(Chart tChart, Donut donut, Annotation annotation, Annotation annotationMin, Annotation annotationMax)
        {
            tChart.Aspect.View3D          = false;
            tChart.Panel.Gradient.Visible = false;
            tChart.Panel.Color            = Color.White;
            tChart.Legend.Visible         = false;
            tChart.Header.Text            = "Speed";
            tChart.Header.Alignment       = TextAlignment.End;
            tChart.Panel.MarginBottom    -= 50;

            tChart.Series.Add(donut);

            tChart.Tools.Add(annotation);
            tChart.Tools.Add(annotationMin);
            tChart.Tools.Add(annotationMax);

            donut.AngleSize     = 180;
            donut.Marks.Visible = false;
            donut.Circled       = true;
            donut.Pen.Width     = 2;

            annotation.Shape.Transparent    = true;
            annotationMin.Shape.Transparent = true;
            annotationMax.Shape.Transparent = true;

            annotation.TextAlign    = TextAlignment.Center;
            annotationMin.TextAlign = TextAlignment.Center;
            annotationMax.TextAlign = TextAlignment.Center;

            annotation.Shape.CustomPosition    = true;
            annotationMin.Shape.CustomPosition = true;
            annotationMax.Shape.CustomPosition = true;

            tChart.AfterDraw += TChart1_AfterDraw;
        }
示例#9
0
 public void CreateDonut(Donut donut)
 {
     if (donut == null)
     {
         throw new ArgumentNullException(nameof(donut));
     }
     _context.Donuts.Add(donut);
 }
示例#10
0
        public void DonutTest()
        {
            Donut donut = new Donut("color me impressed", 457, 6.77, DonutTypeEnum.Caramel);

            service.AddDonut(donut);
            Assert.AreEqual(donut, service.GetDonutById(457));
            service.DeleteDonut(457);
        }
示例#11
0
        public void SpawnDonutOnPointAndMoveToCell(Vector2f point, Cell cell)
        {
            var donut = new Donut(point)
            {
                NewPosition = cell.Position
            };

            cell.Collection.Add(donut);
        }
示例#12
0
    public void OnTriggerEnter(Collider collider)
    {
        GameObject other = collider.gameObject;
        Donut      donut = other.GetComponent <Donut> ();

        if (donut != null)
        {
            other.transform.position = target.transform.position;
        }
    }
示例#13
0
        private async void Donut_Background()
        {
            await Donut.RotateTo(10, 0);

            await Donut.ScaleTo(1.5, 0);

            await Donut.TranslateTo(20, -800, 100000);

            await Donut.TranslateTo(-20, 0, 1);
        }
示例#14
0
文件: Cream.cs 项目: N8-Des/SaltVR
    public void OnTriggerStay(Collider collider)
    {
        GameObject other = collider.gameObject;
        Donut      donut = other.GetComponent <Donut> ();

        if (donut != null)
        {
            donut.TakeDamage(this.damage);
        }
    }
示例#15
0
 private void Start()
 {
     ui    = GetComponentInParent <UI>();
     level = FindObjectOfType <Level>();
     donut = level.GetComponent <Donut>();
     if (donut == null)
     {
         donut = level.gameObject.AddComponent <Donut>();
     }
 }
示例#16
0
 public void OnTriggerStay(Collider collider)
 {
     if (ableToFire)
     {
         GameObject other = collider.gameObject;
         Donut      donut = other.GetComponent <Donut> ();
         fireCoRo = Fire(donut);
         StartCoroutine(fireCoRo);
     }
 }
示例#17
0
    public void OnTriggerExit(Collider collider)
    {
        GameObject other = collider.gameObject;
        Donut      donut = other.GetComponent <Donut> ();

        if (donut != null)
        {
            donuts.Remove(donut);
        }
    }
示例#18
0
 private void Donut_Background()
 {
     Task.WhenAny <bool>
     (
         Donut.RotateTo(10, 0),
         Donut.ScaleTo(1.5, 0),
         Donut.TranslateTo(20, -1000, 100000),
         Donut.TranslateTo(-20, 1000, 0),
         Donut.TranslateTo(20, -1000, 100000)
     );
 }
示例#19
0
    public void Start()
    {
        var player = GameObject.Find("Player");

        _aMa        = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        _chCam      = Camera.main.GetComponent <ChappersCam>();
        _worldMover = GameObject.Find("Road").GetComponent <WorldMover>();
        _anim       = player.GetComponent <AnimHelper>();
        _spin       = player.GetComponentInChildren <DonutSpin>();
        _donut      = player.GetComponent <Donut>();
    }
        public void Can_create_instance_with_default_vaules()
        {
            var donut = new Donut();

            donut.ShouldNotBeNull();

            donut.Id.ShouldBe(default(int));
            donut.Name.ShouldBeNull();
            donut.Toppings.ShouldNotBeNull();
            donut.Toppings.ShouldBeEmpty();
        }
示例#21
0
        public void DonutAddAndGet()
        {
            Donut c = new Donut("SugarHigh", 999, 12.5, DonutTypeEnum.Chocolate);

            Assert.AreEqual(repository.GetDonutsNumber(), 4);
            repository.AddDonut(c);
            Assert.AreEqual(repository.GetDonutsNumber(), 5);
            Donut temp = repository.GetDonut(999);

            Assert.AreEqual(temp, c);
        }
示例#22
0
        public void UpdateInfoDonut()
        {
            Donut temp = repository.GetDonut(2);

            Assert.AreEqual(7.6, temp.Price);
            Donut c = new Donut("Jam-Packed", 2, 12.9, DonutTypeEnum.Jelly);

            repository.UpdateDonutInfo(c);
            temp = repository.GetDonut(2);
            Assert.AreEqual(12.9, temp.Price);
        }
示例#23
0
 private void Start()
 {
     ui    = FindObjectOfType <UI>();
     level = FindObjectOfType <Level>();
     donut = level.GetComponent <Donut>();
     dream = FindObjectOfType <DreamSpawner>();
     if (donut == null)
     {
         donut = level.gameObject.AddComponent <Donut>();
     }
 }
 public override void Draw()
 {
     Donut.Draw(base.GetColor());
     if (!_drawRadius)
     {
         return;
     }
     if (_radiusMax > 0)
     {
         ExtDrawGuizmos.DebugWireSphere(Donut.Position, Color.red, _radiusMax * transform.lossyScale.Maximum());
     }
 }
示例#25
0
        public void GenarateData(DataContext data)
        {
            for (int i = 1; i <= 9; i++)
            {
                Donut donut = new Donut(GenerateRandomString(25),
                                        i, randomPrice(5.00, 15.90), randomDonutType());
                data.catalog.products.Add(i, donut);

                Customer customer = new Customer(GenerateRandomString(6), GenerateRandomString(13), i.ToString());
                data.clients.Add(customer);
            }
        }
示例#26
0
    /* Hal Assisted Code*/
    public IEnumerator Fire(Donut donut)
    {
        if (donut != null)
        {
            donut.TakeDamage(this.damage);
            ableToFire = false;
            Debug.Log("BOOM");
            yield return(new WaitForSeconds(atkSpeed));

            Debug.Log("RELOAD");
            ableToFire = true;
        }
    }
示例#27
0
    public void Interact(Donut interactor)
    {
        //Add points
        interactor.Score += points;

        //Play sound
        AMa.Play(sound);

        //Do visuals
        Camera.main.GetComponent <ChappersCam>().Shake(shake);

        //Call Unique
        Unique(interactor);
    }
示例#28
0
        public void RestockTest()
        {
            Customer supplier = new Customer("Britney", "Spears", "B11");

            service.AddCustomer(supplier);
            Donut    donut = new Donut("Hit me baby one more time", 997, 4.20, DonutTypeEnum.Vanilla);
            DateTime now   = DateTime.Now;

            service.AddandUpdate(donut, 0);
            int stateThen = service.GetStateOfDonut(997);

            service.Restock("B11", 997, now, 112);
            Assert.AreEqual(stateThen + 112, service.GetStateOfDonut(997));
        }
示例#29
0
        public ActionResult UpdateDonut(int id, Donut donut)
        {
            var donutFromRepo = _repository.GetDonutById(id);

            if (donutFromRepo == null)
            {
                return(NotFound());
            }

            _repository.UpdateDonut(donut);
            _repository.SaveChanges();

            return(NoContent());
        }
示例#30
0
        public void BuyDonutsTest()
        {
            Customer customer = new Customer("Wanda", "Owca", "W5");

            service.AddCustomer(customer);
            Donut    donut = new Donut("Peanut butter&", 876, 8.77, DonutTypeEnum.Jelly);
            DateTime now   = DateTime.Now;

            service.AddandUpdate(donut, 50);
            int stateThen = service.GetStateOfDonut(876);

            service.BuyDonut("W5", 876, now, 17);
            Assert.AreEqual(stateThen - 17, service.GetStateOfDonut(876));
        }
示例#31
-23
 void Start()
 {
     donutTrigger = GetComponent<Donut>();
     this.maxPlacingRange = 5f;
 }
示例#32
-26
 BaseSprite LoadDonut(BaseSprite sprite, string texturedir, XElement part)
 {
     Donut f = new Donut(this);
     f.Initialize(Content);
     f.Rot = sprite.Rot;
     f.Position = sprite.Position;
     return f;
 }