public void MoveRole(RoleModel role) { if (role.IsOnBoat()) { LandModel land; if (boat.GetBoatSign() == false) { land = end_land; } else { land = start_land; } boat.DeleteRoleByName(role.GetName()); role.Move(land.GetEmptyPosition()); role.GoLand(land); land.AddRole(role); } else { LandModel land = role.GetLandModel(); if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign()) { return; } land.DeleteRoleByName(role.GetName()); role.Move(boat.GetEmptyPosition()); role.GoBoat(boat); boat.AddRole(role); } user_gui.sign = Check(); }
public void AI() { int side = boat.GetBoatSign() == 1 ? 0 : 1; LandModel land = side == 0 ? start_land : end_land; int p = (start_land.GetRoleNum())[0] + (1 - side) * (boat.GetRoleNumber())[0]; int d = (start_land.GetRoleNum())[1] + (1 - side) * (boat.GetRoleNumber())[1]; SolverState cur_state = new SolverState(p, d, side); SolverState next_state = Solve.solve(cur_state); int move_p = next_state.p - p > 0 ? next_state.p - p : p - next_state.p; int move_d = next_state.d - d > 0 ? next_state.d - d : d - next_state.d; while (move_p < boat.GetRoleNumber()[0]) { MoveRole(boat.GetRoleByType(0)); return; } while (move_d < boat.GetRoleNumber()[1]) { MoveRole(boat.GetRoleByType(1)); return; } while (move_p > boat.GetRoleNumber()[0]) { MoveRole(land.GetRoleByType(0)); return; } while (move_d > boat.GetRoleNumber()[1]) { MoveRole(land.GetRoleByType(1)); return; } MoveBoat(); }
public void Reset() { land_model = (SSDirector.GetInstance().CurrentScenceController as Controllor).start_land; GoLand(land_model); SetPosition(land_model.GetEmptyPosition()); land_model.AddRole(this); }
public void LoadResources() { Debug.Log("DD"); GameObject water = Instantiate(Resources.Load("Prefabs/Water", typeof(GameObject)), new Vector3(0, -1, 0), Quaternion.identity) as GameObject; water.name = "water"; start_land = new LandModel("start"); end_land = new LandModel("end"); boat = new BoatModel(); role = new RoleModel[6]; for (int i = 0; i < 3; i++) { RoleModel r = new RoleModel("priest"); r.SetName("priest" + i); r.SetPosition(start_land.GetEmptyPosition()); r.GoLand(start_land); start_land.AddRole(r); role[i] = r; } for (int i = 3; i < 6; i++) { RoleModel r = new RoleModel("devil"); r.SetName("devil" + i); r.SetPosition(start_land.GetEmptyPosition()); r.GoLand(start_land); start_land.AddRole(r); role[i] = r; } }
// Start is called before the first frame update void Start() { mainController = (FirstController)SSDirector.GetInstance().CurrentSenceController; this.leftLandModel = mainController.leftLandController.GetLandModel(); this.rightLandModel = mainController.rightLandController.GetLandModel(); this.boatModel = mainController.boatController.GetBoatModel(); }
public void CreateLand() { if (landModel == null) { landModel = new LandModel(); } }
public ActionResult EditProperty(int id, PropertyTypeClassifier type) { PropertyViewOperation p = new PropertyViewOperation(); if (type == PropertyTypeClassifier.Apartament) { ApartmentModel model = p.GetPropertyApartment(id); return View("~/Views/Property/Submit.cshtml", model); } else if (type == PropertyTypeClassifier.House) { HouseModel model = p.GetPropertyHouse(id); return View("~/Views/Property/Submit.cshtml", model); } else if (type == PropertyTypeClassifier.Commercial) { CommercialModel model = p.GetPropertyCommercial(id); return View("~/Views/Property/Submit.cshtml", model); } else { LandModel model= p.GetPropertyLand(id); return View("~/Views/Property/Submit.cshtml", model); } }
public ActionResult SubmitLand(LandModel model, HttpPostedFileBase[] files) { if (files.Length == 1 && files[0] == null && !model.HasImage) { ModelState.AddModelError(string.Empty, "A photo file must be chosen."); } if (ModelState.IsValid) { PhotoProcessing(files, model); LandOperation operation = new LandOperation(); var result = operation.Execute(model, User.Identity.GetUserId()); if (result.IsSuccess) { PropertyViewOperation op = new PropertyViewOperation(); var resultModel = op.GetProperties(null, User.Identity.GetUserId()); return RedirectToAction("Index", resultModel); } } return View("Submit", model); }
public void LoadResources() //创建水,陆地,角色,船 { GameObject water = Instantiate(Resources.Load("Water", typeof(GameObject)), new Vector3(0, -6, 0), Quaternion.identity) as GameObject; water.name = "water"; start_land = new LandModel("start"); end_land = new LandModel("end"); boat = new BoatModel(); roles = new RoleModel[6]; for (int i = 0; i < 3; i++) { RoleModel role = new RoleModel("priest"); role.SetName("priest" + i); role.SetPosition(start_land.GetEmptyPosition()); role.GoLand(start_land); start_land.AddRole(role); roles[i] = role; } for (int i = 0; i < 3; i++) { RoleModel role = new RoleModel("devil"); role.SetName("devil" + i); role.SetPosition(start_land.GetEmptyPosition()); role.GoLand(start_land); start_land.AddRole(role); roles[i + 3] = role; } }
public void CreateLand(string name, Vector3 position) { if (landModel == null) { landModel = new LandModel(name, position); } landModel.priestNum = landModel.devilNum = 0; }
public LandViewModel() { ObjLandService = new LandService(); LoadData(); CurrentLand = new LandModel(); saveCommand = new RelayCommand(Save); searchCommand = new RelayCommand(Search); updateCommand = new RelayCommand(Update); deleteCommand = new RelayCommand(Delete); }
public void MoveRole(RoleModel role) //移动角色 { if (user_gui.sign != 0) { return; } if (role.IsOnBoat()) { LandModel land; if (boat.GetBoatSign() == -1) { land = end_land; } else { land = start_land; } boat.DeleteRoleByName(role.GetName()); Vector3 end_pos = land.GetEmptyPosition(); //动作分离版本改变 Vector3 middle_pos = new Vector3(role.getGameObject().transform.position.x, end_pos.y, end_pos.z); //动作分离版本改变 actionManager.moveRole(role.getGameObject(), middle_pos, end_pos, role.move_speed); //动作分离版本改变 role.GoLand(land); land.AddRole(role); } else { LandModel land = role.GetLandModel(); if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign()) { return; //船没有空位,也不是船停靠的陆地,就不上船 } land.DeleteRoleByName(role.GetName()); Vector3 end_pos = boat.GetEmptyPosition(); //动作分离版本改变 Vector3 middle_pos = new Vector3(end_pos.x, role.getGameObject().transform.position.y, end_pos.z); //动作分离版本改变 actionManager.moveRole(role.getGameObject(), middle_pos, end_pos, role.move_speed); //动作分离版本改变 role.GoBoat(boat); boat.AddRole(role); } user_gui.sign = Check(); /*if (user_gui.sign == 1) * { * for (int i = 0; i < 3; i++) * { * roles[i].PlayGameOver(); * roles[i + 3].PlayGameOver(); * } * }*///f**k }
// Get: api/Lands/id public IHttpActionResult GetLandById(string id) { LandModel land = null; using (SoilCareEntities db = new SoilCareEntities()) { land = db.Lands .Where(s => s.Land_id.Equals(id)) .Select(AutoMapper.Mapper.Map <Land, LandModel>) .FirstOrDefault(); } if (land == null) { return(NotFound()); } return(Ok(land)); }
public void MoveRole(RoleModel role) //移动角色 { if (user_gui.sign != 0) { return; } if (role.IsOnBoat()) { LandModel land; if (boat.GetBoatSign() == -1) { land = end_land; } else { land = start_land; } boat.DeleteRoleByName(role.GetName()); role.Move(land.GetEmptyPosition()); role.GoLand(land); land.AddRole(role); } else { LandModel land = role.GetLandModel(); if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign()) { return; //船没有空位,也不是船停靠的陆地,就不上船 } land.DeleteRoleByName(role.GetName()); role.Move(boat.GetEmptyPosition()); role.GoBoat(boat); boat.AddRole(role); } user_gui.sign = Check(); if (user_gui.sign == 1) { for (int i = 0; i < 3; i++) { // roles[i].PlayGameOver(); // roles[i + 3].PlayGameOver(); } } }
public void LoadResource() { for (int i = 0; i < 3; i++) { RoleModel priest = new RoleModel("priest"); priest.SetName("priest" + i); priest.SetPosition(new Vector3(5 + i * 0.5F, 0, 0)); Priests[i] = priest; RoleModel devil = new RoleModel("devil"); devil.SetName("devil" + i); devil.SetPosition(new Vector3(7 + i * 0.5F, -0.1F, 0)); devil.Idle(); Devils[i] = devil; } RightLand = new LandModel("right"); LeftLand = new LandModel("left"); River = new RiverModel(); Boat = new BoatModel(); }
public void LoadResources() { water = new Water(); startLand = new LandModel("start"); endLand = new LandModel("end"); boat = new BoatModel(); roles = new RoleModel[6]; for (int i = 0; i < 3; i++) { RoleModel role = new RoleModel("priest", startLand.GetEmptyPosition()); role.SetName("priest" + i); startLand.AddRole(role); roles[i] = role; } for (int i = 0; i < 3; i++) { RoleModel role = new RoleModel("devil", startLand.GetEmptyPosition()); role.SetName("devil" + i); startLand.AddRole(role); roles[i + 3] = role; } }
public void MoveRole(RoleModel r) { if (gui.sign != 0) { return; } if (r.IsOnBoat()) { LandModel land; if (boat.GetBoatSign() == -1) { land = end_land; } else { land = start_land; } boat.DeleteRoleByName(r.GetName()); //r.Move(land.GetEmptyPosition()); manager.moveRole(r.GetGameObject(), new Vector3(r.GetGameObject().transform.position.x, land.GetEmptyPosition().y, land.GetEmptyPosition().z), land.GetEmptyPosition(), r.speed); r.GoLand(land); land.AddRole(r); } else { LandModel land = r.GetLandModel(); if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign()) { return; } land.DeleteRoleByName(r.GetName()); //r.Move(boat.GetEmptyPosition()); manager.moveRole(r.GetGameObject(), new Vector3(boat.GetEmptyPosition().x, r.GetGameObject().transform.position.y, boat.GetEmptyPosition().z), boat.GetEmptyPosition(), r.speed); r.GoBoat(boat); boat.AddRole(r); } gui.sign = judge.Check(); }
public int LandofLocation(LandModel landModel) { using (var context = new INVENTORYEntities()) { Land land = new Land(); land.location = landModel.Location; land.itemname = landModel.ItemName; land.SubLocation = landModel.SubLocation; land.length = landModel.Length; land.breadth = landModel.Breadth; land.area = landModel.Area; land.qty = landModel.Quantity; // valve.status = valveModel.Status; land.discription = landModel.Description; land.UserName = UserNameSessionData; context.Land.Add(land); context.SaveChanges(); return(land.itemcode); } }
public List <PropertyModel> GetProperty() { List <PropertyModel> model = new List <PropertyModel>(); PaginationModel paging = new PaginationModel(); XmlDocument doc = new XmlDocument(); doc.Load(HttpContext.Current.Server.MapPath("propertyList.xml")); XmlNode RETSRes = doc.SelectSingleNode("/RETS"); XmlNode RETSRes2 = doc.DocumentElement.SelectSingleNode("/RETS-RESPONSE"); XmlNode RETSRes4 = doc.DocumentElement.SelectSingleNode("RETS-RESPONSE"); XmlNode RETSRes5 = doc.DocumentElement.SelectSingleNode("RETS-RESPONSE/Pagination"); XmlNode RETSRes6 = RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination"); XmlNode RETSRes3 = RETSRes.SelectSingleNode("/RETS-RESPONSE"); paging.TotalRecores = Convert.ToInt32(RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination/TotalRecords").InnerText); paging.Limit = Convert.ToInt32(RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination/Limit").InnerText); paging.Offset = Convert.ToInt32(RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination/Offset").InnerText); paging.TotalPages = Convert.ToInt32(RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination/TotalPages").InnerText); paging.RecordsReturned = Convert.ToInt32(RETSRes.SelectSingleNode("RETS-RESPONSE/Pagination/RecordsReturned").InnerText); XmlNodeList proDetails = RETSRes.SelectNodes("RETS-RESPONSE/PropertyDetails"); foreach (XmlNode pro in proDetails) { PropertyModel promodel = new PropertyModel(); List <AgentModel> agentList = new List <AgentModel>(); LandModel land = new LandModel(); BuildingModel building = new BuildingModel(); XmlAttributeCollection proatt = pro.Attributes; promodel.PropertyDetailsID = Convert.ToInt32(proatt["ID"].Value); promodel.LastUpdated = Convert.ToDateTime(proatt["LastUpdated"].Value); promodel.ListingID = pro.SelectSingleNode("ListingID").InnerText; XmlNodeList agentsxml = pro.SelectNodes("AgentDetails"); foreach (XmlNode agentxml in agentsxml) { AgentModel Agmodel = new AgentModel(); OfficeModel offiModel = new OfficeModel(); Agmodel.AgentDetailsID = Convert.ToInt32(agentxml.Attributes["ID"].Value); Agmodel.Name = agentxml.SelectSingleNode("Name").InnerText; Agmodel.OfficeID = Convert.ToInt32(agentxml.SelectSingleNode("Office/@ID").Value); offiModel.OfficeID = Convert.ToInt32(agentxml.SelectSingleNode("Office/@ID").Value); offiModel.Name = agentxml.SelectSingleNode("Office/Name").InnerText; offiModel.City = agentxml.SelectSingleNode("Office/Address/City").InnerText; Agmodel.Position = agentxml.SelectSingleNode("Position").InnerText; Agmodel.Office = offiModel; agentList.Add(Agmodel); } promodel.Board = pro.SelectSingleNode("Board").InnerText; promodel.Business = pro.SelectSingleNode("Business").InnerText; building.BathroomTotal = Convert.ToInt32(pro.SelectSingleNode("Building/BathroomTotal").InnerText); building.BedroomsTotal = Convert.ToInt32(pro.SelectSingleNode("Building/BedroomsTotal").InnerText); building.CoolingType = pro.SelectSingleNode("Building/CoolingType").InnerText; building.FireplacePresent = Convert.ToBoolean(pro.SelectSingleNode("Building/FireplacePresent").InnerText.ToLower()); building.HeatingFuel = pro.SelectSingleNode("Building/HeatingFuel").InnerText; building.HeatingType = pro.SelectSingleNode("Building/HeatingType").InnerText; building.SizeInterior = pro.SelectSingleNode("Building/SizeInterior").InnerText; building.Type = pro.SelectSingleNode("Building/Type").InnerText; land.Acreage = Convert.ToBoolean(pro.SelectSingleNode("Land/Acreage").InnerText); land.SizeTotal = Convert.ToInt32(pro.SelectSingleNode("Land/SizeTotal").InnerText.Replace("sqft", "").Trim()); land.SizeTotalText = pro.SelectSingleNode("Land/SizeTotalText").InnerText; promodel.AddressLine1 = pro.SelectSingleNode("Address/AddressLine1").InnerText; promodel.StreatAddress = pro.SelectSingleNode("Address/StreetAddress").InnerText; promodel.City = pro.SelectSingleNode("Address/City").InnerText; promodel.PostalCode = pro.SelectSingleNode("Address/PostalCode").InnerText; promodel.Country = pro.SelectSingleNode("Address/Country").InnerText; promodel.Province = pro.SelectSingleNode("Address/Province").InnerText; promodel.Features = pro.SelectSingleNode("Features").InnerText; promodel.FarmType = pro.SelectSingleNode("FarmType").InnerText; if (pro.SelectSingleNode("Lease") != null) { promodel.Lease = pro.SelectSingleNode("Lease").InnerText; } if (pro.SelectSingleNode("LeasePerTime") != null) { promodel.LeasePerTime = pro.SelectSingleNode("LeasePerTime").InnerText; } promodel.OwnershipType = pro.SelectSingleNode("OwnershipType").InnerText; promodel.Price = Convert.ToDecimal(pro.SelectSingleNode("Price").InnerText); promodel.PropertyType = pro.SelectSingleNode("PropertyType").InnerText; promodel.PublicRemarks = pro.SelectSingleNode("PublicRemarks").InnerText; promodel.TransactionType = pro.SelectSingleNode("TransactionType").InnerText; promodel.UtilitiesAvailable = pro.SelectSingleNode("UtilitiesAvailable").InnerText; promodel.ViewType = pro.SelectSingleNode("ViewType").InnerText; promodel.WaterFrontType = pro.SelectSingleNode("WaterFrontType").InnerText; promodel.AnalyticsClick = pro.SelectSingleNode("AnalyticsClick").InnerText; promodel.AnalyticsView = pro.SelectSingleNode("AnalyticsView").InnerText; promodel.MoreInformationLink = pro.SelectSingleNode("MoreInformationLink").InnerText; XmlNodeList photoes = pro.SelectNodes("Photo/PropertyPhoto"); List <PhotoModel> picsModel = new List <PhotoModel>(); foreach (XmlNode photo in photoes) { PhotoModel phomodel = new PhotoModel(); phomodel.SequenceID = Convert.ToInt32(photo.SelectSingleNode("SequenceId").InnerText); phomodel.LastUpdated = Convert.ToDateTime(photo.SelectSingleNode("LastUpdated").InnerText); picsModel.Add(phomodel); } promodel.Photos = picsModel; promodel.Agents = agentList; promodel.Building = building; promodel.Land = land; model.Add(promodel); } return(model); }
public void GoBoat(BoatModel boat) { role.transform.parent = boat.GetBoat().transform; land_model = null; on_boat = true; }
} //动作分离版本新增 public void GoLand(LandModel land) { role.transform.parent = null; land_model = land; on_boat = false; }
public LandModel GetPropertyLand(int id) { LandModel model = new LandModel(); using (PMSContext db = new PMSContext()) { var dbmodel = db.Properties.FirstOrDefault(x => x.PropertyId == id); model.PropertyType = (PropertyTypeClassifier)dbmodel.TypeId; model.PropertyStatus = (PropertyStatusClassifier)dbmodel.SellingCondition; model.PropertyId = dbmodel.PropertyId; model.Price = dbmodel.Price; //addresss model.PropertyDescription = dbmodel.PropertyDescription; var addressModel = db.PropertyAddresses.FirstOrDefault(x => x.PropertyAddressId == dbmodel.PropertyAddressId); model.City = addressModel.CityId; model.District = addressModel.DistrictId; model.Metro = addressModel.MetroId; model.AddressDescription = addressModel.Description; //photo model.Photos = new List <PhotoModel>(); foreach (var d in db.Photos.Where(x => x.PropertyId == dbmodel.PropertyId)) { model.Photos.Add(new PhotoModel { PhotoPath = d.PhotoPath }); } //apart model.LandAreaLand = dbmodel.LandArea; model.HasImage = true; //feature var ft = db.PropertyFeatures.Where(x => x.PropertyId == dbmodel.PropertyId); foreach (var f in ft) { var fea = db.Features.FirstOrDefault(x => x.FeatureId == f.FeatureId); if (fea.FeatureTitle == "Credit") { model.CreditLand = true; } if (fea.FeatureTitle == "HasDocument") { model.HasDocumentLand = true; } if (fea.FeatureTitle == "Fence") { model.FenceLand = true; } if (fea.FeatureTitle == "Gas") { model.GasLand = true; } if (fea.FeatureTitle == "Water") { model.WaterLand = true; } if (fea.FeatureTitle == "Electric") { model.ElectricLand = true; } } } Repository rep = new Repository(); model.DistrictList = rep.GetDistricts(model.City); model.MetroList = rep.GetMetroes(model.City); return(model); }
public Judge(LandModel start_, LandModel end_, BoatModel boat_) { start = start_; end = end_; boat = boat_; }