Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Add unit stuff#15

Open
gnawinganimal wants to merge 1 commit intodevelopmentfrom
units
Open

Add unit stuff#15
gnawinganimal wants to merge 1 commit intodevelopmentfrom
units

Conversation

@gnawinganimal
Copy link
Copy Markdown
Member

Units

@sertbot
Copy link
Copy Markdown

sertbot Bot commented Feb 3, 2019

Hi @Jamdan2, thanks for opening this pull request!

Looks like this is an addition or fix for the robot. To make sure this change goes added in smoothly, make sure the following chores are complete (please check-off items as they are completed):

  • Test code changes on the robot (if possible).

  • Verify that significant changes have tests and pass successfully.

  • Ensure this pull request is appropriately titled.

Maintainers – please review this PR. A review from the @SouthEugeneRoboticsTeam/reviewers team is required before the PR can be merged.

Finally, use @sertbot merge to merge this PR into the appropriate branch.

Thanks!


val m = Unit(Unit.Type.Linear, 1.0)
val inch = Unit(Unit.Type.Linear, 39.3701)
val et = Unit(Unit.Type.Linear, 26876.6549)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et? encoder tick?

import java.lang.Math.PI
import java.util.stream.Collector

data class Unit<T : Unit.Type>(val type: T, val factor: Double) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, gotta come up with a different name for this since it shadow's Kotlin's built-in Unit, (causing this build to fail, eg:

fun String.asResource(body: (String) -> Unit) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha I realized that too! Why do they even call it Unit? Can't they just call it Void? Or None? Or something that makes sense? 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants