template.php 782 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // Template PHP minimal pour neutral
  3. if (!interface_exists('MapTemplateInterface')) {
  4. interface MapTemplateInterface
  5. {
  6. public static function id(): string;
  7. public static function applyTemplate($map): void;
  8. public static function tileDefinitions(): array;
  9. }
  10. }
  11. class NeutralTemplate implements MapTemplateInterface
  12. {
  13. public static function id(): string
  14. {
  15. return 'neutral';
  16. }
  17. public static function applyTemplate($map): void
  18. {
  19. // aucun changement, template neutre
  20. }
  21. public static function tileDefinitions(): array
  22. {
  23. return [
  24. ['id' => 'empty', 'name' => 'Vide', 'color' => '#eee'],
  25. ['id' => 'grass', 'name' => 'Herbe', 'color' => '#8fd694']
  26. ];
  27. }
  28. }