units testing
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
use bevy::prelude::Resource;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use world_generation::hex_utils::HexCoord;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ResourceIdentifier {
|
||||
@@ -1,7 +1,8 @@
|
||||
pub mod building;
|
||||
pub mod despawn;
|
||||
pub mod resource;
|
||||
pub mod identifiers;
|
||||
pub mod states;
|
||||
pub mod tags;
|
||||
pub mod events;
|
||||
pub mod sets;
|
||||
pub mod resources;
|
||||
|
||||
22
game/shared/src/resources.rs
Normal file
22
game/shared/src/resources.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use bevy::prelude::*;
|
||||
use world_generation::hex_utils::HexCoord;
|
||||
|
||||
#[derive(Resource, Default)]
|
||||
pub struct TileUnderCursor(pub Option<TileContact>);
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct TileContact {
|
||||
pub tile: HexCoord,
|
||||
pub point: Vec3,
|
||||
pub surface: Vec3,
|
||||
}
|
||||
|
||||
impl TileContact {
|
||||
pub fn new(tile: HexCoord, contact: Vec3, surface: Vec3) -> Self {
|
||||
return Self {
|
||||
tile,
|
||||
point: contact,
|
||||
surface,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user