PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/SDK/api/CSharp/ClassLibrary1/SkyportObserver.cs

https://bitbucket.org/ehvattum/draugr_contrib
C# | 77 lines | 17 code | 13 blank | 47 comment | 0 complexity | 542b12eb7861359da2c819f0a29a6952 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Skyport
  6. {
  7. public interface SkyportObserver
  8. {
  9. /**
  10. * Called when the SkyportConnection
  11. * is first established. You can keep the
  12. * object reference for later calls.
  13. */
  14. void OnConnectionEstablished(SkyportConnection connection);
  15. /**
  16. * Called when the server accepted
  17. * your handshake.
  18. */
  19. void OnHandshakeSuccessful();
  20. /**
  21. * Called whenever the server sent
  22. * an error.
  23. *
  24. * @param errorMessage The error message as sring
  25. */
  26. void OnError(string errorMessage);
  27. /**
  28. * Called when the initial gamestate
  29. * (called GAMESTART) with round number
  30. * 0 arrives.
  31. *
  32. * @param mapObject Contains all information
  33. * about the board, resources etc.
  34. */
  35. void OnGamestart(Map mapObject);
  36. /**
  37. * Called whenever a gamestate arrives.
  38. *
  39. * @param turnNumber The number of the current turn
  40. *
  41. * @param mapObject Contains all information
  42. * about the board, resources etc.
  43. *
  44. * @param playersOnBattlefield Contains a list
  45. * of PlayerData objects that contain
  46. * information about the players in the game.
  47. */
  48. void OnGamestate(long turnNumber, Map mapObject, PlayerData[] playersOnBattlefield);
  49. /**
  50. * Called whenever a player performed an action.
  51. *
  52. * @param performingPlayerName The name of the player who performed the action
  53. *
  54. * @param type the type of the action (e.g. "laser", "move", ...)
  55. *
  56. * @param arguments the rest of the arguments of the action as dictionary
  57. */
  58. void OnAction(string performingPlayerName, string type, Dictionary<string, object> arguments);
  59. /**
  60. * Called whenever a turn has ended.
  61. */
  62. void OnEndturn();
  63. }
  64. }