Advertisement
Guest User

gpt 3 response - commenting code

a guest
Aug 26th, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. 1. Generate a summary for this function:
  2. public void Pause()
  3. {
  4. if (PauseTimeLeft <= 0)
  5. {
  6. return;
  7. }
  8. IsPaused = true;
  9. PacketNotifier.NotifyPauseGame((int)PauseTimeLeft, true);
  10. }
  11.  
  12. 2. Output:
  13. /// <summary>
  14. /// Temporarily prevents the game loop from continuing and notifies players.
  15. /// </summary>
  16.  
  17. 3. Generate a summary for this function:
  18. public void Unpause()
  19. {
  20. _lastMapDurationWatch.Start();
  21. IsPaused = false;
  22. _pauseTimer.Enabled = false;
  23. }
  24.  
  25. 4. Output:
  26. <GPT-3 summary>
  27.  
  28. 5. Ideal summary which may be generated for the above function:
  29. /// <summary>
  30. /// Releases the game loop from a temporary pause.
  31. /// </summary>
  32.  
  33. FUNCTIONS WITH PARAMETERS:
  34.  
  35. 6. Generate a summary for this function:
  36. public void NotifyAddXp(IChampion champion, float experience)
  37. {
  38. var xp = new AddXp(champion, experience);
  39. _packetHandlerManager.BroadcastPacket(xp, Channel.CHL_S2C);
  40. }
  41.  
  42. 7. Output:
  43. /// <summary>
  44. /// Sends a packet to all players that the specified Champion has gained the specified amount of experience.
  45. /// </summary>
  46. /// <param name="champion">Champion that gained the experience.</param>
  47. /// <param name="experience">Amount of experience gained.</param>
  48.  
  49. 8. Generate a summary for this function:
  50. public void NotifyChampionDie(IChampion champion, IAttackableUnit killer, int goldFromKill)
  51. {
  52. var cd = new ChampionDie(champion, killer, goldFromKill);
  53. _packetHandlerManager.BroadcastPacket(cd, Channel.CHL_S2C);
  54.  
  55. NotifyChampionDeathTimer(champion);
  56. }
  57.  
  58. 9. Output:
  59. /// <summary>
  60. /// Sends a packet to all players that the specified Champion has died and the killer acquired gold for this kill.
  61. /// </summary>
  62. /// <param name="champion">Champion that died.</param>
  63. /// <param name="killer">Killer of the specified Champion.</param>
  64. /// <param name="goldFromKill">Amount of gold acquired from killing this Champion.</param>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement