SouthEugeneRoboticsTeam / sertain

Framework for programming FRC robots, inspired by Sertain Legacy and Meanlib
6 stars 0 forks source link

Subsystem revision #68

Closed gnawinganimal closed 4 years ago

gnawinganimal commented 4 years ago

This is a pretty big change on the inside, but is basically the same on the outside.

gnawinganimal commented 4 years ago

Here's an example of a subsystem with a default task and setup function:

class Arm : Subsystem() {
    override val default: Default = {
         println("Running default task")
    }

    override val setup: Setup = {
        println("Setting stuff up")
    }
}

Notice that the name is gone, because it is now inferred by the class name. It can be overridden if you want, though.

gnawinganimal commented 4 years ago

Okay I fixed stuff and now its not dumb. Now it would be

class Arm : Subsystem() {
    override suspend fun CoroutineScope.default() {
         println("Running default task")
    }

    override fun CoroutineScope.setup() {
        println("Setting stuff up")
    }
}
gnawinganimal commented 4 years ago

That's weird it worked fine on my device

gnawinganimal commented 4 years ago

Okay it was some weird bug with github actions, the JDK didn't download right