public void AddPhoto(WaifuClass waifu) { PhotoClass newPhoto = new PhotoClass(); newPhoto.waifu = waifu; float distance = Vector3.Distance(player.transform.position, waifu.transform.position); newPhoto.size = Mathf.Round(1000f - (distance * 25f)); if (distance < waifu.perfectDistance) { newPhoto.size = 1000 * (distance / 100); } if (newPhoto.size < 100) { newPhoto.size = 100; } newPhoto.pose = 1000; newPhoto.technique = true; newPhoto.totalScore = newPhoto.size + newPhoto.pose; if (newPhoto.technique) { newPhoto.totalScore *= 2; } photos.Add(newPhoto); }
public void BindPhotoClass() { using (PhotoClass a = new PhotoClass()) { a.Select().Bind(View); } }
public ActionResult Create(Models.PhotoModel photo, HttpPostedFileBase file) { using (var context = new MvcDataContext()) { // TODO: Add insert logic here if (photo != null) { var phot = new PhotoClass(); phot.PhotoName = file.FileName; phot.PhotoId = Guid.NewGuid(); phot.Date = DateTime.Now; Path.GetFileName(file.FileName); file.SaveAs(Path.Combine(Server.MapPath("~/Pictures"), file.FileName)); context.photo.Add(phot); context.SaveChanges(); } return(View()); } }
public static Directory Spawn(Directory directory, PhotoClass PhotoClass, GameOutput GameOutput, Vector2 Position, Transform Parent) { directory.PhotoClass = PhotoClass; directory.GameOutput = GameOutput; directory.Text.text = PhotoClass.ClassName; return(directory); }
public static IEnumerator GetEnumeratorDataInput(System.Action <GameInput> callback) { JsonResponse response = null; yield return(GetDataFromServer(r => response = r)); var faces = new PhotoClass("Faces"); var facePhotos = new List <PhotoInfo>(); foreach (var pair in response.getMainClassPhotoUrls(faces)) { yield return(GetPhoto(texture => facePhotos.Add(new PhotoInfo(texture, faces, pair.Key)), pair.Value)); } var other = new PhotoClass("Other"); var otherPhotos = new List <PhotoInfo>(); foreach (var pair in response.getOtherClassPhotoUrls()) { yield return(GetPhoto(texture => otherPhotos.Add(new PhotoInfo(texture, other, pair.Key)), pair.Value)); } var photos = facePhotos.Concat(otherPhotos).ToList(); var input = new GameInput { Photos = photos, MainClass = faces, OtherClass = other }; callback(input); }
public static PhotoModel MapPhotoModel(PhotoClass photo) { return(new PhotoModel { PhotoId = photo.PhotoId, PhotoName = photo.PhotoName, PComment = PhotoModelMapping.MapCommentsModel(photo.PComment), }); }
public static PhotoModel ModelToEntity(PhotoClass photoentity) { PhotoModel model = new PhotoModel(); model.PhotoId = photoentity.PhotoId; model.PhotoName = photoentity.PhotoName; return(model); }
public static PhotoClass EntityToModel(PhotoModel photoMod) { PhotoClass entity = new PhotoClass(); entity.PhotoId = photoMod.PhotoId; entity.PhotoName = photoMod.PhotoName; return(entity); }
public void DeletePhoto(PhotoClass photo) { using (var context = new MvcDataContext()) { var photoToDelete = context.photo.Include("Comment").FirstOrDefault(p => p.PhotoId == photo.PhotoId); context.photo.Remove(photoToDelete); context.photo.AddOrUpdate(photoToDelete); context.SaveChanges(); } }
public Dictionary <int, string> getMainClassPhotoUrls(PhotoClass photoClass) { var dict = new Dictionary <int, string>(); phrases.Where(p => correct_phrases.Contains(p.id)).ToList().ForEach(p => { var link = p.media[0].data.Replace("\\", string.Empty); var id = p.id; dict.Add(id, link); }); return(dict); }
public ActionResult PhotoList() { using (var context = new MVCProjektContext()) { var NewPhoto = new PhotoClass(); NewPhoto.PhotoId = Guid.NewGuid(); NewPhoto.PhotoName = "Kanduni"; context.photo.Add(NewPhoto); context.SaveChanges(); } return(View(db.photo.ToList())); }
public void BindPhotoList() { PhotoClass pc = DBFast.Find <PhotoClass>(Query <string>("id")); if (pc != null) { View.Set("title", pc.Name + " - Taurus.MVC"); } using (Photo a = new Photo()) { a.Select("CateID=" + Query <string>("id")).Bind(View); } }
public void AddPhoto(PhotoClass newphoto) { using (var context = new MvcDataContext()) { PhotoClass photo = new PhotoClass(); photo.PhotoId = newphoto.PhotoId; photo.PhotoName = newphoto.PhotoName; photo.PComment = newphoto.PComment; context.photo.Add(photo); context.photo.AddOrUpdate(photo); context.SaveChanges(); } }
public void Assign(PhotoClass photoClass, PhotoInfo photoInfo) { Selection[photoClass].Add(photoInfo); }
public PhotoInfo(Texture2D texture, PhotoClass photoClass, int id) { Texture = texture; ID = id; PhotoClass = photoClass; }