Advertisement
Guest User

Untitled

a guest
Mar 16th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.89 KB | None | 0 0
  1. using ICities;
  2.  
  3. namespace LevelingLimit
  4. {
  5.     public class LevelingLimit : IUserMod
  6.     {
  7.         public string Name { get { return "LevelingLimit"; } }
  8.         public string Description { get { return "Limit's leveling of buildings"; } }
  9.     }
  10.  
  11.     public class LevelUpExtension : LevelUpExtensionBase
  12.     {
  13.         public override void OnCreated(ILevelUp levelUp) { }
  14.  
  15.         public override void OnReleased() { }
  16.  
  17.         public override ResidentialLevelUp OnCalculateResidentialLevelUp(ResidentialLevelUp levelUp, int averageEducation, int landValue, ushort buildingID, Service service, SubService subService, Level currentLevel)
  18.         {
  19.             if (levelUp.targetLevel > Level.Level3)
  20.                 levelUp.targetLevel = Level.Level3;
  21.  
  22.             return levelUp;
  23.         }
  24.  
  25.         public override CommercialLevelUp OnCalculateCommercialLevelUp(CommercialLevelUp levelUp, int averageWealth, int landValue, ushort buildingID, Service service, SubService subService, Level currentLevel)
  26.         {
  27.             if (levelUp.targetLevel > Level.Level2)
  28.                 levelUp.targetLevel = Level.Level2;
  29.  
  30.             return levelUp;
  31.         }
  32.  
  33.         public override IndustrialLevelUp OnCalculateIndustrialLevelUp(IndustrialLevelUp levelUp, int averageEducation, int serviceScore, ushort buildingID, Service service, SubService subService, Level currentLevel)
  34.         {
  35.             if (levelUp.targetLevel > Level.Level2)
  36.                 levelUp.targetLevel = Level.Level2;
  37.  
  38.             return levelUp;
  39.         }
  40.  
  41.         public override OfficeLevelUp OnCalculateOfficeLevelUp(OfficeLevelUp levelUp, int averageEducation, int serviceScore, ushort buildingID, Service service, SubService subService, Level currentLevel)
  42.         {
  43.             if (levelUp.targetLevel > Level.Level2)
  44.                 levelUp.targetLevel = Level.Level2;
  45.  
  46.             return levelUp;
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement