Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Reflection;
- using ICities;
- using UnityEngine;
- namespace UnlimitedMoneyMod
- {
- public class UnlimitedMoney : MarshalByRefObject, IUserMod
- {
- public void OnLoad()
- {
- Debug.Log("OnLoad" + AppDomain.CurrentDomain.FriendlyName);
- using (StreamWriter file = new System.IO.StreamWriter("Assemblies.txt"))
- {
- Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
- foreach (Assembly assembly in assemblies)
- {
- file.WriteLine(assembly.FullName);
- }
- file.WriteLine("");
- foreach (Assembly assembly in assemblies)
- {
- file.WriteLine(assembly.FullName);
- if (assembly != null)
- {
- Type[] types;
- try
- {
- types = assembly.GetTypes();
- }
- catch (ReflectionTypeLoadException ex)
- {
- types = ex.Types;
- }
- foreach (Type subType in types)
- {
- file.WriteLine(" " + subType.Name);
- if(assembly.FullName.equals(“ColossalManaged”)){
- MemberInfo[] Members = subType.GetMembers();
- foreach (MemberInfo NextMember in Members)
- {
- file.WriteLine(“ “ + NextMember.DeclaringType + “ " + NextMember.MemberType + “ " + NextMember.Name);
- }
- }
- }
- }
- }
- }
- }
- public void OnUnload()
- {
- }
- public string Name
- {
- get { return "Unlimited Money"; }
- }
- public string Description
- {
- get { return "Money never runs out"; }
- }
- }
- public class UnlimitedMoneyEconomy : EconomyExtensionBase
- {
- public override long OnUpdateMoneyAmount(long internalMoneyAmount)
- {
- return long.MaxValue;
- }
- public override bool OverrideDefaultPeekResource
- {
- get { return true; }
- }
- public override int OnPeekResource(EconomyResource resource, int amount)
- {
- return amount;
- }
- }
- /*
- public class UnlimitedMoney : MarshalByRefObject, IEconomy
- {
- public long StartingMoney()
- {
- Debug.Log("UnlimitedMoney.StartingMoney " + System.AppDomain.CurrentDomain.FriendlyName);
- return long.MaxValue;
- }
- public long GetLastCashAmount(long current)
- {
- return 50000;
- }
- public Economy.Resource GetOverrides()
- {
- return Economy.Resource.ConstructionCost |
- Economy.Resource.LoanAmount |
- Economy.Resource.LandPrice |
- Economy.Resource.RewardAmount |
- Economy.Resource.BailoutAmount |
- Economy.Resource.RefundAmount;
- }
- public int PeekResource(ICities.Economy.Resource resource, int amount)
- {
- return amount;
- }
- public int FetchResource(ICities.Economy.Resource resource, int amount)
- {
- return amount;
- }
- public int AddResource(ICities.Economy.Resource resource, int amount)
- {
- return 0;
- }
- public void OnCreate()
- {
- }
- public void OnUpdate(ITerrain terrain)
- {
- if (Input.GetKeyDown(KeyCode.F7))
- {
- Debug.Log("UnlimitedMoney.OnCreate " + System.AppDomain.CurrentDomain.FriendlyName);
- byte[] b = new byte[1081 * 1081 * 2];
- for (int z = 0; z <= 1080; ++z)
- {
- int srcIndex = z * (1080 + 1) * 2;
- for (int x = 0; x <= 1080; ++x)
- {
- ushort s = (ushort)(((x % 256) + 40) * 60);
- b[srcIndex++] = (byte)(s & 0xFF);
- b[srcIndex++] = (byte)(s >> 8);
- }
- }
- terrain.OnCreate(b);
- }
- }
- public void OnRelease()
- {
- }
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement