How to find items in my storage in C#?

Started by mugenzebra, November 10, 2016, 10:57:50 PM

Previous topic - Next topic

mugenzebra

Hi, does anyone know is it possible to find items in my storage like I can find all my animals with
p in Find.MapPawns.AllPawnsSpawned
                     where p.RaceProps.Animal
                     select p

I really hope there's an API documentation on this, is there?
Edit: I actually found my VS2015 can look into Assembly-CSharp and see all the interfaces!

MinutesToWeekend

You can use Find.ListerThings and query from there.

If you haven't already, you should download ILSpy (preferably Zhentar's branch here https://github.com/Zhentar/ILSpy), which will let you easily inspect the DLLs.

mugenzebra

#2
Quote from: MinutesToWeekend on November 11, 2016, 12:39:14 AM
You can use Find.ListerThings and query from there.

If you haven't already, you should download ILSpy (preferably Zhentar's branch here https://github.com/Zhentar/ILSpy), which will let you easily inspect the DLLs.
Thanks, I actually just found the members of Find object is a great place to look for bunch of stuff I want. I haven't figured out how to use ListerThings yet, but hopefully I will :D
I haven't looked at ILSpy, hmm interesting, hope that let me take a look at source code!
EDIT: Wow, I just tried ILSpy, it's amazing, being able to look at source code helps a lot!

mugenzebra

Quote from: MinutesToWeekend on November 11, 2016, 12:39:14 AM
You can use Find.ListerThings and query from there.

If you haven't already, you should download ILSpy (preferably Zhentar's branch here https://github.com/Zhentar/ILSpy), which will let you easily inspect the DLLs.

I just found Find.ResourceCounter.GetCount() seems to be exactly what I want. I just need to figure out how it works now.