Jump to content

3 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hi,

I am trying to go through the code of TransferManager as I believe it is somehow related to ridiculous behaviour of material deliveries, especially in industry areas.

So first I need to understand exactly what each method in the class does.

 

So first question:

Perhaps someone already investigated TransferManager and knows how it works exactly? If so could you share?

 

If not.

So for simplicity I thought I will just create my class and inherit TransferManager just to have all references working.

Almost worked.

I use VisualStudio.

I have declared my class as

 class KM_TransportManager : TransferManager

But the problem is I only have direct access to public properties and methods of original TransferManager. But it's most interesting methods are "private" and "protected".

Is there a way I can define my class to have access to this methods and properties?

Or I must copy/past them to my class directly?

 

Cris.

 

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

You must use C# reflection (google it)

There is already a mod that changes the Transfer Manager behavior, but I myself didn't check it out. You can look at its source code.

Check out this tutorial how to attach debugger to Cities:Skylines and how to decompile the code if you didn't do that already.

By the way, as a matter of principle I would not recommend inheritance as a good way how to change the code (it causes bugs). You can use Harmony to redirect method calls. But for now that is probably too advanced, so play with the code anyhow you can.

Hope this helped at least a little bit although it doesn't answer your question.

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Hi, Thanks,

    Thank you for suggestion, although I was not going to inherit class for making changes. I did this to make understanding easier for references to work in VisualStudio.

    I will definitely have a look on the tutorial and linked mod.

     

    Thanks.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections