Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bevyjam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Graphics
bevyjam
Commits
7faced6a
Commit
7faced6a
authored
2 years ago
by
Evy Storozhenko
Browse files
Options
Downloads
Patches
Plain Diff
initial battery work
parent
392d1945
No related branches found
No related tags found
No related merge requests found
Pipeline
#103487
passed
2 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/machine/battery.rs
+9
-0
9 additions, 0 deletions
src/machine/battery.rs
src/machine/mod.rs
+1
-0
1 addition, 0 deletions
src/machine/mod.rs
src/power.rs
+3
-0
3 additions, 0 deletions
src/power.rs
with
13 additions
and
0 deletions
src/machine/battery.rs
0 → 100644
+
9
−
0
View file @
7faced6a
use
crate
::
power
::{
Capacity
,
Source
};
use
bevy
::
prelude
::
*
;
#[derive(Bundle)]
pub
struct
BatteryBundle
{
pub
source
:
Source
,
pub
capacity
:
Capacity
,
}
This diff is collapsed.
Click to expand it.
src/machine/mod.rs
+
1
−
0
View file @
7faced6a
...
...
@@ -7,6 +7,7 @@ use crate::{
use
bevy
::
prelude
::
*
;
mod
cable
;
mod
battery
;
pub
const
MACHINE_SIZE
:
Vec2
=
Vec2
::
new
(
GRID_SIZE
.x
/
8.0
,
GRID_SIZE
.y
/
8.0
);
...
...
This diff is collapsed.
Click to expand it.
src/power.rs
+
3
−
0
View file @
7faced6a
...
...
@@ -17,6 +17,9 @@ impl Plugin for PowerPlugin {
}
}
#[derive(Component,
Copy,
Clone,
Debug,
Deref)]
pub
struct
Capacity
(
pub
f32
);
/// Any entity that can emit power (a generator, cable, etc.) should have
/// source as one of it's components. The output field defines in which directions
/// the entity may output power and the power field controls the amount of
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment