ketura

OverrideFunction

Sep 22nd, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. /////////////////////////////////
  2. //                             //
  3. //  OVERRIDE FUNCTION EXAMPLE  //
  4. //                             //
  5. /////////////////////////////////
  6. using System;
  7.  
  8. namespace RenegadeCore
  9. {
  10.     public partial class StartingStats
  11.     {
  12.         public static readonly List<StatInfo> SpeciesStats;
  13.  
  14.         static StartingStats()
  15.         {
  16.             SpeciesStats = new List<StatInfo>()
  17.             {
  18.                 new StatInfo("HP")
  19.                 new StatInfo("AKT")
  20.             };
  21.         }
  22.     }
  23. }
  24.  
  25.  
  26. namespace AwesomeMod
  27. {
  28.     public partial class StartingStats
  29.     {
  30.         [OverrideFunction]
  31.         static StartingStats()
  32.         {
  33.             //Some moron mispelled ATK in this and only this function.  Fixing it for truth and justice.
  34.             SpeciesStats = new List<StatInfo>()
  35.             {
  36.                 new StatInfo("HP")
  37.                 new StatInfo("ATK")
  38.             };
  39.         }
  40.     }
  41. }
  42.  
  43. //results in:
  44. using System;
  45.  
  46. namespace RenegadeCore
  47. {
  48.     public partial class StartingStats
  49.     {
  50.         public static readonly List<StatInfo> SpeciesStats;
  51.  
  52.         static StartingStats()
  53.         {
  54.             //>>>>Overwritten by AwesomeMod<<<<//
  55.             //Some moron mispelled ATK in this and only this function.  Fixing it for truth and justice.
  56.             SpeciesStats = new List<StatInfo>()
  57.             {
  58.                 new StatInfo("HP")
  59.                 new StatInfo("ATK")
  60.             };
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment