not really known
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.

30 lines
601 B

  1. define(function (require) {
  2. var directions = {};
  3. directions.orders = ['north', 'east', 'south', 'west'];
  4. directions.orders.forEach(function (dir, i) {
  5. directions[dir] = i;
  6. });
  7. directions.getOpposite = function (direction) {
  8. switch(direction) {
  9. case 'north':
  10. return 'south';
  11. break;
  12. case 'south':
  13. return 'north';
  14. break;
  15. case 'east':
  16. return 'west';
  17. break;
  18. case 'west':
  19. return 'east';
  20. break;
  21. }
  22. }
  23. return directions;
  24. });