Thursday, May 5, 2011

Side Tracked in designing the Spring Class

Time to start the Spring class.

The spring class will maintain a its own state as a reservoir of ticks. The number of ticks will be increased using a wind method and – while is has ticks – be released by calling the hands. Of course, it will also have to create and maintain the hands.

I'll need a new script to wrap the Spring class –

And then I ran into trouble.

It seems that – using Add-Type as I was – you can't import a class like my new Spring class because it refers to another class (Hand) that the compiler can't find.

I spend some time trying to figure out how to get the compiler to find it, but it was not working.

What I did come up with was a little different way to do my source files. I can give Add-Type a path instead of a string. I'm going to implement that now and call it a day.


foreach ($a in dir .\Code) {

"CODE FILE: $a"

invoke-expression "Add-Type -path Code\$a -IgnoreWarnings"}

foreach ($a in dir .\Test) {

"TEST SCRIPT: $a"

invoke-expression "Test\$a" }

I added the Ignore Warnings flag because it was giving me a warning-as-error about declaring but not using some hand objects. That will be fixed pretty soon.

No comments:

Post a Comment