public void Init() { spriteRenderer = GetComponent <SpriteRenderer>(); anim = GetComponent <Animator>(); npc = GetComponentInParent <NPC>(); pies = npc.pies; }
public virtual void Init(NPC npc) { m_npc = npc; m_pathfinder = npc.pathfinder; m_pies = npc.pies; m_ciudad = npc.ciudad; }
public IHttpActionResult UpdatePie(int id, Pies pies) { if (!ModelState.IsValid) { //throw new HttpResponseException(HttpStatusCode.BadRequest); return(BadRequest("Model data is invalid")); } var pieInDb = _context.Pies.Include(m => m.PieCategory).SingleOrDefault(c => c.Id == id); if (pieInDb == null) { //throw new HttpResponseException(HttpStatusCode.NotFound); return(NotFound()); } pieInDb.Name = pies.Name; pieInDb.SDescription = pies.SDescription; pieInDb.LDescription = pies.LDescription; pieInDb.Price = pies.Price; pieInDb.IsPieOfTheWeek = pies.IsPieOfTheWeek; pieInDb.InStock = pies.InStock; pieInDb.PieCategoryId = pies.PieCategoryId; pieInDb.Image = pies.Image; pieInDb.ImageThumb = pies.ImageThumb; _context.SaveChanges(); return(Ok()); }
public void Init() { npc = GetComponentInParent <NPC>(); m_ciudad = npc.ciudad; pies = npc.pies; m_movimiento = npc.movimiento; AddPosActual(); }
static void Main(string[] args) { Pies p = new Pies(); p.JakSiePoruszam(); Console.ReadKey(); }
public bool CreatePizza(string name) { var svc = new PizzaServiceClient(); var count = Pies.Count; Pies.AddRange(svc.OrderPizza(name, 1).ToList()); return(Pies.Count > count); }
public void Init() { npc = GetComponentInParent <NPC>(); col2D = npc.col2D; m_ciudad = npc.ciudad; m_pathfinder = npc.pathfinder; pies = npc.pies; ojos = npc.ojos; }
static void Main(string[] args) { Pies wyżełAzor = new Pies { Nazwa = "Azor", Kolor = Color.SaddleBrown, Waga = 15.5m }; Pies pudelFafik = new Pies { Nazwa = "Fafik", Kolor = Color.Gray, Waga = 5.75m }; Console.WriteLine(wyżełAzor.ToString()); Console.WriteLine(pudelFafik.ToString()); pudelFafik.Nazwa = "Bogdan"; Console.WriteLine(pudelFafik.ToString()); pudelFafik = wyżełAzor; pudelFafik.Nazwa = "Brutus"; Console.WriteLine(wyżełAzor.ToString()); Console.WriteLine(pudelFafik.ToString()); int a = 1; int b = 2; int c; c = (a + b); a = 5; c = a + b; Console.WriteLine(c); b = 6; Console.WriteLine(c); var d = new Sumator(); d.A = 1; d.B = 2; Console.WriteLine(d.ToString()); d.A = 5; Console.WriteLine(d); }
public IHttpActionResult CreatePie(Pies pies) { if (!ModelState.IsValid) { //throw new HttpResponseException(HttpStatusCode.BadRequest); return(BadRequest("Model data is invalid")); } _context.Pies.Add(pies); _context.SaveChanges(); return(Ok(pies)); }
private void AddPie() { var pie = new Pie { Description = "I am moist and delicious", ImageUrl = "strawberrypiesmall.jpg", IsInStock = true, Name = "New Pie", Price = 13.95 }; Pies.Add(pie); }
// Use this for initialization void Start() { pies = GetComponentInChildren <Pies>(); trailRenderer = GetComponent <TrailRenderer>(); habilidad = GetComponent <Habilidad>(); nivelDeExperiencia = GetComponent <NivelDeExperiencia>(); salud = GetComponent <Salud>(); inputJugador = GetComponent <InputPlayer>(); miRigidbody2D = GetComponent <Rigidbody2D>(); //El rigidbody2d de este gameObject animator = GetComponent <Animator>(); miSprite = GetComponent <SpriteRenderer>(); atacante = GetComponent <Atacante>(); correrHashCode = Animator.StringToHash("Corriendo"); PanelAtributos.instance.ActualizarTextosAtributos(atributosJugador, salud, nivelDeExperiencia); }
static void Main(string[] args) { Zwierze p = new Pies(); Zwierze k = new Kot(); Zwierze m = new Krowa(); Zwierze t = new Mysz(); Zwierze w = new Waz(); Trener.DajGlos(p); Trener.DajGlos(k); Trener.DajGlos(m); Trener.DajGlos(t); Trener.DajGlos(w); Console.ReadKey(); }
void Awake() { ciudad = GetComponentInParent <Ciudad>(); spriteRenderer = GetComponent <SpriteRenderer>(); movimiento = InstantiateComponent(movimientoPrefab).GetComponent <Movimiento>(); pies = InstantiateComponent(piesPrefab).GetComponent <Pies>(); ojos = InstantiateComponent(ojosPrefab).GetComponent <Ojos>(); pathfinder = GetComponentInChildren <PathfinderNPC>(); animador = GetComponentInChildren <AnimadorNPC>(); col2D = GetComponent <BoxCollider2D>(); pies.Init(); pathfinder.Init(); movimiento.Init(); ojos.Init(); animador.Init(); ciudad.NPCs.Add(pathfinder); }
public void Setup() { Burger burgerOne = new Burger("Biggest Baddest Burger", 5000, 250, 25, 500, "Ground Angus", 27.96, new List <string>() { "Bacon", "More Bacon", "Some Eggs" }, 3); Burger burgerTwo = new Burger("V-Burg", 650, 15, 35, 100, "Impossible Patty", 16.95, new List <string>() { "V-Cheese", "Tomato", "Lettuce" }, 2); Burger burgerThree = new Burger("Cowboys Last Ride", 777, 20, 70, 50, "Minecraft Horse Meat", 19.20, new List <string>() { "Freshly Ground Creeper", "Arrow Shot From Skeleton", "Blaze Rod Powder" }, 3); Burgers.AddRange(new FoodItem[] { burgerOne, burgerTwo, burgerThree }); Milkshake shakeone = new Milkshake("Chocolate", "Malt", "Chocolate Thundas Protein Shake", 200, 10, 50, 00, 9.99, 1); Milkshake shaketwo = new Milkshake("Vanilla", "Classic Shake", "Vanilla Willy's Olde Fashioned", 200, 50, 5, 100, 12.15, 2); Milkshake shakeThree = new Milkshake("Strawberry", "Float", "Strawberry Sink or Float", 350, 25, 5, 0, 7.99, 2); Shakes.AddRange(new FoodItem[] { shakeone, shaketwo, shakeThree }); Fries fryOne = new Fries("Sweet Potato", "Criss-Cut", "Sweeties Sweet Potato Frydish", 750, 300, 20, 200, 8.75, 3); Fries fryTwo = new Fries("Golden Russett", "Classic French", "Golden Frenchies", 400, 95, 10, 100, 5.95, 1); Fries fryThree = new Fries("Purple Potato", "Tater Tot", "Purple Power Balls", 450, 75, 17, 20, 12.39, 2); Fries.AddRange(new FoodItem[] { fryOne, fryTwo, fryThree }); FrontDeskPie pieOne = new FrontDeskPie("Hostess", 125, 9, 5, 25, 7.25, "Chocolate Sunrise", true); FrontDeskPie pieTwo = new FrontDeskPie("Grandma", 200, 0, 20, 50, 12.12, "Mostly Love But Some Rhubarb Crisp", false); FrontDeskPie pieThree = new FrontDeskPie("Neighbor Joe", 150, 5, 10, 40, 10.99, "Mystery", true); Pies.AddRange(new FoodMerch[] { pieOne, pieTwo, pieThree }); Food = Burgers; Messages.Add($@" _ _ _ | | | | | | | |__ _ _ _ __ __ _ ___ _ __ ___| |__ __ _ ___| | __ | '_ \| | | | '__/ _` |/ _ \ '__/ __| '_ \ / _` |/ __| |/ / | |_) | |_| | | | (_| | __/ | \__ \ | | | (_| | (__| < |_.__/ \__,_|_| \__, |\___|_| |___/_| |_|\__,_|\___|_|\_\ __/ | |___/ "); Messages.Add("\nBurgers Available\n"); }
public ActionResult AddtoCart(Pies pies, string qty, int id) { var pie = _context.Pies.Where(x => x.Id == id).SingleOrDefault(); Cart c = new Cart(); c.productid = pie.Id; c.price = (float)pie.Price; c.qty = Convert.ToInt32(qty); c.bill = c.price * c.qty; c.productname = pie.Name; if (TempData["Cart"] == null) { li.Add(c); TempData["Cartcounter"] = li.Count; TempData["Cart"] = li; } else { List <Cart> li2 = TempData["Cart"] as List <Cart>; int flag = 0; foreach (var item in li2) { if (item.productid == c.productid) { item.qty += c.qty; item.bill += c.bill; flag = 1; } } if (flag == 0) { li2.Add(c); } TempData["Cartcounter"] = li2.Count + li.Count; TempData["Cart"] = li2; } TempData.Keep(); return(RedirectToAction("Index", "Home")); }
public ActionResult SavePie(Pies pies) { if (pies.Id == 0) { _context.Pies.Add(pies); } else { var pieInDb = _context.Pies.Single(c => c.Id == pies.Id); pieInDb.Name = pies.Name; pieInDb.SDescription = pies.SDescription; pieInDb.LDescription = pies.LDescription; pieInDb.Price = pies.Price; pieInDb.IsPieOfTheWeek = pies.IsPieOfTheWeek; pieInDb.InStock = pies.InStock; pieInDb.PieCategoryId = pies.PieCategoryId; pieInDb.Image = pies.Image; pieInDb.ImageThumb = pies.ImageThumb; } _context.SaveChanges(); return(RedirectToAction("Index", "Admin")); }
public ActionResult SavePie(Pies pies) { if (pies.Id == 0) { HttpResponseMessage response = GlobalVariables.webApiClient.PostAsJsonAsync("PieApi", pies).Result; } else { //var pieInDb = _context.Pies.Single(c => c.Id == pies.Id); //pieInDb.Name = pies.Name; //pieInDb.SDescription = pies.SDescription; //pieInDb.LDescription = pies.LDescription; //pieInDb.Price = pies.Price; //pieInDb.IsPieOfTheWeek = pies.IsPieOfTheWeek; //pieInDb.InStock = pies.InStock; //pieInDb.PieCategoryId = pies.PieCategoryId; //pieInDb.Image = pies.Image; //pieInDb.ImageThumb = pies.ImageThumb; HttpResponseMessage response = GlobalVariables.webApiClient.PutAsJsonAsync($"PieApi/{pies.Id}", pies).Result; } //_context.SaveChanges(); return(RedirectToAction("AllPie", "Admin")); }
static void Main(string[] args) { AbstractClass Pies = new Pies(); Pies.Przedstaw(); AbstractClass Kot = new Kot(); Kot.Przedstaw(); AbstractClass Krowa = new Krowa(); Krowa.Przedstaw(); AbstractClass Ptak = new Ptak(); Ptak.Przedstaw(); // Wait for user Console.ReadKey(); }
public pie GetPieById(int pieId) { return(Pies.FirstOrDefault(p => p.PieId == pieId)); }
public ActionResult Create(Pies pies) { _context.Pies.Add(pies); _context.SaveChanges(); return(RedirectToAction("Index", "Admin")); }
public Pie GetPieById(int pieId) => Pies.SingleOrDefault(pie => pie.PieId == pieId);
public Pie GetPieById(int pieId) { //throw new System.NotImplementedException(); return(Pies.FirstOrDefault(p => p.PieId == pieId)); }