Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Cartes
  8. {
  9. public class Board
  10. {
  11. private List<Photo> photos;
  12.  
  13. public Board()
  14. {
  15. photos = new List<Photo>();
  16. }
  17.  
  18. public int Length
  19. {
  20. get
  21. {
  22. return photos.Count;
  23. }
  24. }
  25.  
  26. public void Add(Photo photo)
  27. {
  28. photos.Add(photo);
  29. }
  30.  
  31. public void Delete(Photo photo)
  32. {
  33. photos.Remove(photo);
  34. }
  35.  
  36. public Photo FindPhoto(int x, int y)
  37. {
  38. return photos.LastOrDefault(
  39. photo => photo.Intersection(x, y));
  40. }
  41.  
  42. public void MoveToFront(Photo photo)
  43. {
  44. photos.Remove(photo);
  45. photos.Add(photo);
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement