Advertisement
Guest User

Poorly Written C#

a guest
Apr 24th, 2021
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class Square
  2. {
  3. public int x;
  4. public int y;
  5. public int height = -1;
  6.  
  7. public bool IsAdjacent(Square s)
  8. {
  9. if((s.x - x == 1 || s.x - x == -1 || s.x - x == 0) &&
  10. (s.y - y == 1 || s.y - y == -1 || s.y - y == 0))
  11. return true;
  12. else
  13. return false;
  14. }
  15. }
  16.  
  17.  
  18. public class Action
  19. {
  20. public string type;
  21. public int index;
  22. public string move;
  23. public string build;
  24. public double score;
  25. public Square moveFrom;
  26. public Square moveTo; // pushed square
  27. public Square buildAt; // pushed to
  28.  
  29. public override string ToString()
  30. {
  31. return type + " " + index + " " + move + " " + build;
  32. }
  33.  
  34. public void Evaluate()
  35. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement