/// <summary> /// TODO: Write a test covering GetStartingInfluence /// </summary> /// <param name="house"></param> /// <param name="track"></param> /// <returns></returns> public static int GetStartingInfluence(HouseName house, InfluenceTrackType track) { var xml = XDocument.Load(@"Data\Houses.xml"); return((int)xml.Descendants("house") .First(x => house == GameData.ParseHouse(x)).Attribute("starting" + track.ToString())); }
public static int GetStartingSupply(HouseName house) { var xml = XDocument.Load(@"Data\Houses.xml"); return((int)xml.Descendants("house") .First(x => house == GameData.ParseHouse(x)).Attribute("startingSupply")); }
public void parseXml(Stream stream) { DateTime now = DateTime.Now; houses = new List <HouseName>(); plants = new List <PlantName>(); dates = new Dictionary <int, DateTemp>(); stream.Position = 0; XDocument xml = XDocument.Load(stream); foreach (XElement el in xml.Root.Element("houses").Elements("house")) { var house = new HouseName { name = el.Attribute("Name").Value }; houses.Add(house); foreach (XElement element in el.Elements()) { DateTemp dateTemp = new DateTemp { dateTime = getDate(element), temperature = getDouble(element, "Weather") }; TimeSpan span = (dateTemp.dateTime - DateTemp.zeroCountDateTime); dateTemp.daysNumber = span.Days; HouseDetail houseDetail = new HouseDetail { localDateTemp = now, userName = getUserName(), daysNumber = dateTemp.daysNumber, consumptionHouse = getDouble(element, "Consumption") }; if (!dates.ContainsKey(span.Days)) { dates.Add(span.Days, dateTemp); } house.listHouseDetails.Add(houseDetail); } } foreach (XElement el in xml.Root.Elements("plants").Elements()) { PlantName plant = new PlantName { name = el.Attribute("Name").Value }; plants.Add(plant); foreach (XElement element in el.Elements()) { TimeSpan span = getDate(element) - DateTemp.zeroCountDateTime; PlantDetail plantDetail = new PlantDetail { localDateTemp = now, userName = getUserName(), daysNumber = span.Days, price = getDouble(element, "Price"), consumptionPlant = getDouble(element, "Consumption") }; plant.listPlantDetails.Add(plantDetail); } } saveToDb(); }
public Npc(int id, string name, HouseName house, string description) : base(id, name, house) { Id = id; Name = name; House = house; Description = description; }
public override int GetHashCode() { unchecked { var hashCode = (Trafokreis != null ? Trafokreis.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ProviderType != null ? ProviderType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)SumType; hashCode = (hashCode * 397) ^ (int)GenerationOrLoad; hashCode = (hashCode * 397) ^ (HouseName != null ? HouseName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ProfileSource != null ? ProfileSource.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (HouseComponentType != null ? HouseComponentType.GetHashCode() : 0); return(hashCode); } }
public Military( int id, string name, int locationid, HouseName house, string description, List <string> messages, int skillLevel, Weapon currentWeapon) : base(id, name, house, description) { Messages = messages; SkillLevel = skillLevel; CurrentWeapon = currentWeapon; }
/// <summary> /// TODO: Write a test covering GetStartingInfluence /// </summary> /// <param name="house"></param> /// <param name="track"></param> /// <returns></returns> public static int GetStartingInfluence(HouseName house, InfluenceTrackType track) { var xml = XDocument.Load(@"Data\Houses.xml"); return (int) xml.Descendants("house") .First(x => house == GameData.ParseHouse(x)).Attribute("starting" + track.ToString()); }
public void EnterHouseName(string housename) { HouseName.Clear(); HouseName.SendKeys(housename); }
private void ExecuteShowReport() { Result = null; SearchStatus = String.Empty; if (SelectedContributionColumns.Count == 0) { MessageBox.Show("No Columns selected"); return; } if (DateTime.Compare(StartDate.Date, EndDate.Date) > 0) { MessageBox.Show("Start Date should be before End Date"); return; } Result = new FlowDocument(); if (!WithDetails) { List <MahalluManager.Model.Contribution> input = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { if (DateTime.Compare(StartDate, EndDate) == 0) { input = unitOfWork.Contributions.GetAll().Where(x => DateTime.Compare(x.CreatedOn, StartDate.Date) == 0).ToList(); } else { input = unitOfWork.Contributions.GetAll().Where(x => DateTime.Compare(x.CreatedOn, StartDate) >= 0 && DateTime.Compare(x.CreatedOn, EndDate) <= 0).ToList(); } if (Category != null) { input = input.Where(x => x.CategoryName == Category.Name).ToList();; } } if (ValidateReportParameters()) { BuildReport(input); } } else { List <MahalluManager.Model.Contribution> input = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { input = unitOfWork.Contributions.GetAll().ToList(); if (Category != null) { input = input.Where(x => x.CategoryName == Category.Name).ToList();; } } List <ContributionDetail> inputDetails = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { if (DateTime.Compare(StartDate, EndDate) == 0) { inputDetails = unitOfWork.ContributionDetails.GetAll().Where(x => DateTime.Compare(x.CreatedOn, StartDate.Date) == 0).ToList(); } else { inputDetails = unitOfWork.ContributionDetails.GetAll().Where(x => DateTime.Compare(x.CreatedOn, StartDate) >= 0 && DateTime.Compare(x.CreatedOn, EndDate) <= 0).ToList(); } } String[] temp = null; if (!String.IsNullOrEmpty(HouseNumber)) { if (HouseNumber.Contains(";")) { temp = HouseNumber.Split(';'); } else { temp = new string[1]; temp[0] = HouseNumber; } if (temp != null) { inputDetails = inputDetails.Where(x => temp.Contains(x.HouserNumber.ToString(), new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(HouseName)) { temp = null; if (HouseName.Contains(";")) { temp = HouseName.Split(';'); } else { temp = new string[1]; temp[0] = HouseName; } if (temp != null) { inputDetails = inputDetails.Where(x => temp.Contains(x.HouserName, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(MemberName)) { temp = null; if (MemberName.Contains(";")) { temp = MemberName.Split(';'); } else { temp = new string[1]; temp[0] = MemberName; } if (temp != null) { inputDetails = inputDetails.Where(x => temp.Contains(x.MemberName, new ContainsComparer())).ToList(); } } if (ValidateReportParameters()) { BuildReport(input, inputDetails); } } }
public Citizen(int id, string name, int locationid, HouseName house, string description, List <string> messages) : base(id, name, house, description) { Messages = messages; }
public override string ToString() { return(HouseName.ToString()); }
private void ExecuteShowReport() { if (SelectedResidenceColumns.Count == 0) { MessageBox.Show("No Columns selected"); Result = null; SearchStatus = String.Empty; return; } Result = new FlowDocument(); List <Residence> input = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { input = unitOfWork.Residences.GetAll().ToList(); String[] temp = null; if (!String.IsNullOrEmpty(Area)) { if (Area.Contains(";")) { temp = Area.Split(';'); } else { temp = new string[1]; temp[0] = Area; } if (temp != null) { input = input.Where(x => temp.Contains(x.Area, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(HouseName)) { temp = null; if (HouseName.Contains(";")) { temp = HouseName.Split(';'); } else { temp = new string[1]; temp[0] = HouseName; } if (temp != null) { input = input.Where(x => temp.Contains(x.Name, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(HouseNumber)) { temp = null; if (HouseNumber.Contains(";")) { temp = HouseNumber.Split(';'); } else { temp = new string[1]; temp[0] = HouseNumber; } if (temp != null) { input = input.Where(x => temp.Contains(x.Number, new ContainsComparer())).ToList(); } } } List <ResidenceMember> members = null; using (UnitOfWork unitOfWork = new UnitOfWork(new MahalluDBContext())) { members = unitOfWork.ResidenceMembers.GetAll().ToList(); String[] temp = null; if (!String.IsNullOrEmpty(MarriageStatus)) { if (MarriageStatus.Contains(";")) { temp = MarriageStatus.Split(';'); } else { temp = new string[1]; temp[0] = MarriageStatus; } if (temp != null) { members = members.Where(x => temp.Contains(x.MarriageStatus, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Country)) { temp = null; if (Country.Contains(";")) { temp = Country.Split(';'); } else { temp = new string[1]; temp[0] = Country; } if (temp != null) { members = members.Where(x => temp.Contains(x.Country, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Qualification)) { temp = null; if (Qualification.Contains(";")) { temp = Qualification.Split(';'); } else { temp = new string[1]; temp[0] = Qualification; } if (temp != null) { members = members.Where(x => temp.Contains(x.Qualification, new ContainsComparer())).ToList(); } } if (!String.IsNullOrEmpty(Gender)) { temp = null; if (Gender.Contains(";")) { temp = Gender.Split(';'); } else { temp = new string[1]; temp[0] = Gender; } if (temp != null) { members = members.Where(x => temp.Contains(x.Gender, new ContainsComparer())).ToList(); } } } if (ValidateReportParameters()) { BuildReport(input, members); } }
public Player(int id, string name, HouseName house) : base(id, name, house) { Id = id; Name = name; House = house; }
public Animals(int id, string name, HouseName house, string description, List <string> messages, string type) : base(id, name, house, description) { Messages = messages; Type = type; }
public Player(HouseName house) { House = house; }
public static int GetStartingSupply(HouseName house) { var xml = XDocument.Load(@"Data\Houses.xml"); return (int) xml.Descendants("house") .First(x => house == GameData.ParseHouse(x)).Attribute("startingSupply"); }
public Character(int id, string name, HouseName house) { _id = id; _name = name; _house = house; }
public Player(HouseName house) { House = house; }