たとえば、 Initialize() メソッドでコードを実行する代わりに、 somecode.run() のような行を書きたいだけで、すべてが実行され、すべてのコードを別の場所に書くことができます。組織のために。
コードがその場所にあったように動作するようにしたいので、プライベートなどにアクセスできます.
これを行う最良の方法は何ですか?
明確にするために編集:
ここに例があります
public class game
{
public void Initialize()
{
I want to run some code here but I don't want to write it here,
I want to write it in another file for the sake of organization,
and just reference it somehow here, but yet still be able to use the
privates as if it was in this spot
}
}