private void SetTotalIndianCountry(Indian response) { if (response != null) { StateWiseListView = new ObservableCollection <Statewise>(); var lastest = response.CasesTimeSeries.LastOrDefault().Dailyconfirmed; //Country = response; //LastUpdateSubtitleCountry = $"{TranslateExtension.TranslateText("CountrySubtitle")} {Country.updated.TransformLongToDateTime().FormatDateTime(App.AppCultureInfo)}"; CountryConfirmed = response.CasesTimeSeries.LastOrDefault().Totalconfirmed.TransformLongToString(); CountryRecovered = response.CasesTimeSeries.LastOrDefault().Totalrecovered.TransformLongToString(); CountryDeaths = response.CasesTimeSeries.LastOrDefault().Totaldeceased.TransformLongToString(); foreach (var item in response.Statewise) { StateWiseListView.Add(item); } //CountryFlag = response.countryInfo.flag; //CountryNameSelected = TranslateExtension.TranslateText(Country.country); } else { //LastUpdateSubtitleCountry = "------------------------------"; CountryConfirmed = "-"; CountryRecovered = "-"; CountryDeaths = "-"; } }
public static void DoCombat(IndianGroup ig, PaleFaceGroup pg) { while (!ig.Dead && !pg.Dead) { int coin = NumberGenerator.Next(0, 1); if (coin == 0) // Indians strike first { Indian i1 = ig.SelectRandomIndian(); if (i1 != null) { PaleFace p1 = pg.SelectRandomPaleFace(); if (p1 != null) { p1.ReceiveDamage(i1.DealDamage()); } } PaleFace p2 = pg.SelectRandomPaleFace(); if (p2 != null) { Indian i2 = ig.SelectRandomIndian(); if (i2 != null) { i2.ReceiveDamage(p2.DealDamage()); } } } else // PaleFaces strike first { PaleFace p2 = pg.SelectRandomPaleFace(); if (p2 != null) { Indian i2 = ig.SelectRandomIndian(); if (i2 != null) { i2.ReceiveDamage(p2.DealDamage()); } } Indian i1 = ig.SelectRandomIndian(); if (i1 != null) { PaleFace p1 = pg.SelectRandomPaleFace(); if (p1 != null) { p1.ReceiveDamage(i1.DealDamage()); } } } } CombatLog.Save("--------------- BATTLE IS OVER ------------"); CombatLog.Save((ig.Dead ? "Palefaces" : "Indians") + " won! Status: "); ig.LogSurvivors(); pg.LogSurvivors(); CombatLog.PrintLog(); }
protected void Page_Load(object sender, EventArgs e) { this.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None; if (!IsPostBack) { delicacies.DataBind(); } selectedProduct = this.GetSelectedProduct(); lblName.Text = selectedProduct.Name; lblShortDescription.Text = selectedProduct.ShortDescription; lblLongDescription.Text = selectedProduct.LongDescription; lblUnitPrice.Text = selectedProduct.UnitPrice.ToString() + " each"; imageFile.ImageUrl = "Images/" + selectedProduct.ImageFile; }
static void Main(string[] args) { American a = new American(); a.canWalk(); a.canSpeak(); Indian b = new Indian(); b.canWalk(); b.canSpeak(); French c = new French(); c.canWalk(); c.canSpeak(); }
private Indian GetSelectedProduct() { DataView delicaciesTable = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty); delicaciesTable.RowFilter = String.Format("DelID='{0}'", delicacies.SelectedValue); DataRowView row = delicaciesTable[0]; Indian i = new Indian(); i.DelID = row["DelID"].ToString(); i.Name = row["Name"].ToString(); i.ShortDescription = row["ShortDescription"].ToString(); i.LongDescription = row["LongDescription"].ToString(); i.UnitPrice = (decimal)row["UnitPrice"]; i.ImageFile = row["ImageFile"].ToString(); return(i); }
static void Main(string[] args) { var myFavoritePet = new Rabbit("Kelly", 2, 4, "Carrots"); myFavoritePet.Jump(); Console.WriteLine(myFavoritePet); var myfavoriteFood = new Indian("Paneer Tikka", "appealing", "medium", 8, "you should try it as it's very delicious"); Console.WriteLine(myfavoriteFood); var myFavoriteCar = new SUV("Toyota", "Rav4", 2016); Console.WriteLine(myFavoriteCar); //var camry = new Cars("Toyota", "Camry", "new", CarType.Convertible); //camry.SetYear(2018); //camry.Ride(); //var dog = new Pets("Tommy", 3, PetType.Dog); //dog.Lick(); //dog.Talk(); //var kachoriChat = new Foods("kachori Chat", CuisineType.Indian); //kachoriChat.SetRating(8); //kachoriChat.SetRating(8, "It's delicious"); //var minion = new Movies("Despicable Me", GenreType.Animation); //minion.SetRating(9); //minion.SetRating(9, "loved it"); //Console.WriteLine($"{dog.Name} is {dog.Age} years old {dog.Type} and {dog.Talk()} and my lick {dog.Lick()}."); //Console.WriteLine($"I like {camry.Type} {camry.Make} {camry.Model} in {camry.Condition} condition! {camry.Ride()}"); //Console.WriteLine($"{kachoriChat.Name} is {kachoriChat.Type} dish and it's rated {kachoriChat.Rating} with review of {kachoriChat.Review}. "); //Console.WriteLine($"{minion.Name} is {minion.Type} movie and it's rated {minion.Rating} with review of {minion.Review}."); Console.ReadLine(); }
public static void Execute() { Dictionary <string, double> exp_i1 = new Dictionary <string, double>(); exp_i1.Add("Krieghoff", 1.2); exp_i1.Add("Tomahawk", 1.4); Dictionary <string, double> exp_i2 = new Dictionary <string, double>(); exp_i2.Add("Damascus", 1.5); Dictionary <string, double> exp_i3 = new Dictionary <string, double>(); exp_i3.Add("StrikerBow", 1.4); exp_i3.Add("DoubleAxe", 1.5); Dictionary <string, double> exp_i4 = new Dictionary <string, double>(); exp_i4.Add("Remington", 1.35); Indian i1 = new Indian("Dances with Conditions", 250, exp_i1, new Krieghoff(), null, null, new JuniorBow(), null, new StrikerBow(), null, new DoubleAxe(), new Tomahawk()); Indian i2 = new Indian("Brown Exception", 240, exp_i2, null, new Remington(), null, null, new LongBow(), new StrikerBow(), new Damascus(), null, null); Indian i3 = new Indian("Constructor of Spirits", 270, exp_i3, null, null, null, new JuniorBow(), null, new StrikerBow(), null, new DoubleAxe(), new Tomahawk()); Indian i4 = new Indian("<T>", 230, exp_i4, null, new Remington(), null, null, null, new StrikerBow(), null, null, new Tomahawk()); Dictionary <string, double> exp_p1 = new Dictionary <string, double>(); exp_p1.Add("Colt", 1.4); exp_p1.Add("SmithWesson", 1.2); Dictionary <string, double> exp_p2 = new Dictionary <string, double>(); exp_p2.Add("Winchester", 1.25); Dictionary <string, double> exp_p3 = new Dictionary <string, double>(); exp_p3.Add("Colt", 1.3); exp_p3.Add("GutterKnife", 1.5); PaleFace p1 = new PaleFace("Sven", 280, exp_p1, new Krieghoff(), null, null, new Colt(), null, new SmithWesson(), null, new DundeeKnife(), null); PaleFace p2 = new PaleFace("Oluf", 240, exp_p2, null, null, new Winchester(), null, new RugerRevolver(), new SmithWesson(), new BowieKnife(), null, null); PaleFace p3 = new PaleFace("Bjarke", 270, exp_p3, null, null, new Winchester(), new Colt(), null, null, new BowieKnife(), null, new GutterKnife()); List <Indian> indians = new List <Indian>(); indians.Add(i1); indians.Add(i2); indians.Add(i3); indians.Add(i4); IndianGroup ig = new IndianGroup(indians); List <PaleFace> paleFaces = new List <PaleFace>(); paleFaces.Add(p1); paleFaces.Add(p2); paleFaces.Add(p3); PaleFaceGroup pg = new PaleFaceGroup(paleFaces); DoCombat(ig, pg); }
public CartItem(Indian product1, int quantity) { this.product1 = product1; this.Quantity = quantity; }
public void AddItem(Indian product1, int quantity) { CartItem c = new CartItem(product1, quantity); cartItems.Add(c); }