Anonymous 3D Imageboard http://cyberia.digital/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.1KB

  1. <?
  2. class Tile {
  3. public $value;
  4. public $display;
  5. public $name;
  6. public $descitption;
  7. function __construct( $value, $display, $name, $descitption) {
  8. $this -> value = $value;
  9. $this -> display = $display;
  10. $this -> name = $name;
  11. $this -> descitption = $descitption;
  12. }
  13. public static function getAllTiles()
  14. {
  15. $tiles = array();
  16. array_push( $tiles, new Tile(0,".","ground","You can walk on it."));
  17. array_push( $tiles, new Tile(1,"█","wall","You cannot go thought it."));
  18. array_push( $tiles, new Tile(2,"#","drawable wall","Like a wall, but you can post on it."));
  19. array_push( $tiles, new Tile(3,"/","gate","An entrance to another level."));
  20. array_push( $tiles, new Tile(4,"D","door","You can open it."));
  21. array_push( $tiles, new Tile(5,"▓","fake wall","You can open it."));
  22. /* array_push( $tiles, new Tile(6,"*","trap","It can kill you."));
  23. array_push( $tiles, new Tile(7,";","grass","just green ground"));
  24. array_push( $tiles, new Tile(8,"±","shrine","Special items goes there."));
  25. array_push( $tiles, new Tile(9,"f","fire","You cannot cross."));
  26. array_push( $tiles, new Tile(10,"R","fast food","You can fullfil your health here"));*/
  27. array_push( $tiles, new Tile(11,"t","seed","You will found torrent of the board here"));
  28. //array_push( $tiles, new Tile(12,"A","Advertisement wall","It's used to display advertisement."));
  29. array_push( $tiles, new Tile(13,"s","Player start","It's the point of arrival of a player. All map need one"));
  30. array_push( $tiles, new Tile(14,"|","gate secret","An entrance to secret level."));
  31. return $tiles;
  32. }
  33. public static function getValueForName($name)
  34. {
  35. $tiles = Tile::getAllTiles();
  36. foreach ($tiles as $tile){
  37. if($tile->name == $name) return $tile->value;
  38. }
  39. return -1;
  40. }
  41. public static function getDisplayForVal($val)
  42. {
  43. $tiles = Tile::getAllTiles();
  44. foreach ($tiles as $tile){
  45. if($tile->value == $val) return $tile->display;
  46. }
  47. return -1;
  48. }
  49. }