diff options
author | Emile <hanemile@protonmail.com> | 2019-02-05 21:06:18 +0100 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-02-05 21:06:18 +0100 |
commit | fcd709c54543056003bf15024e8ae80ec1c8220c (patch) | |
tree | 9858d75a28fe39699907f9d6b2faa17584291f36 | |
parent | 7657df3326c01f072f27156da89b9a7547de3460 (diff) |
fixed the json tagging
-rw-r--r-- | star.go | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/star.go b/star.go index feea20d..f1aaa5c 100644 --- a/star.go +++ b/star.go @@ -1,12 +1,13 @@ package structs -// Define a struct storing essential star information such as it's coordinate, velocity and mass +// Star2D defines a struct storing essential star information such as it's coordinate, velocity and mass type Star2D struct { - C Vec2 `json:C` // coordinates of the star - V Vec2 `json:V` // velocity of the star - M float64 `json:M` // mass of the star + C Vec2 `json:"C"` // coordinates of the star + V Vec2 `json:"V"` // velocity of the star + M float64 `json:"M"` // mass of the star } +// NewStar2D returns a new star using the given arguments as values for the Star func NewStar2D(c Vec2, v Vec2, m float64) Star2D { return Star2D{C: c, V: v, M: m} } @@ -22,18 +23,12 @@ func (s Star2D) InsideOf(boundary BoundingBox) bool { if s.C.Y < boundary.Center.Y+boundary.Width/2 { if s.C.Y > boundary.Center.Y-boundary.Width/2 { return true - } else { - return false } - } else { - return false } - } else { - return false } - } else { - return false } + + return false } // calcNewPos calculates the new position of a star using the force acting on it |