Use enums
This commit is contained in:
parent
5daaf9e1bc
commit
45cad795a7
@ -1,4 +1,5 @@
|
||||
use std::ops::{Add, Div, Mul, Sub};
|
||||
use std::collections::
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct Vector3 {
|
||||
@ -120,6 +121,7 @@ impl Sphere {
|
||||
enum Geometry {
|
||||
Sphere(Sphere),
|
||||
Plane(Plane),
|
||||
Line(Line),
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@ -140,6 +142,7 @@ fn main() {
|
||||
match geo {
|
||||
Geometry::Sphere(s) => println!("A Sphere"),
|
||||
Geometry::Plane(p) => println!("A Plane"),
|
||||
Geometry::Line(l) => println!("A Line"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user