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