use snake case for functions

This commit is contained in:
Morrígan 2025-06-28 15:33:39 +02:00
parent 1a24af7230
commit 9fb75de9be
Signed by: morrigan
GPG key ID: CACB010F463A77D0
3 changed files with 22 additions and 22 deletions

View file

@ -21,7 +21,7 @@ Unit :: struct {
hp: u32,
}
RenderUnit :: proc(unit: Unit, game: ^Game) {
render_unit :: proc(unit: Unit, game: ^Game) {
switch unit.faction {
case Faction.Player:
sdl3.SetRenderDrawColor(game.render, 0, 255, 0, 0)
@ -36,21 +36,21 @@ RenderUnit :: proc(unit: Unit, game: ^Game) {
)
}
NewUnit :: proc {
NewUnitBase,
NewUnitHp,
NewUnitAll
new_unit :: proc {
new_unit_all,
new_unit_base,
new_unit_hp,
}
NewUnitBase :: proc(faction: Faction, position: util.Position) -> Unit {
new_unit_base :: proc(faction: Faction, position: util.Position) -> Unit {
return Unit{faction, position, DEFAULT_VELOCITY, DEFAULT_SPEED, DEFAULT_HP}
}
NewUnitHp :: proc(faction: Faction, position: util.Position, hp: u32) -> Unit {
new_unit_hp :: proc(faction: Faction, position: util.Position, hp: u32) -> Unit {
return Unit{faction, position, DEFAULT_VELOCITY, DEFAULT_SPEED, hp}
}
NewUnitAll :: proc(faction: Faction, position: util.Position, speed: f32, hp: u32) -> Unit {
new_unit_all :: proc(faction: Faction, position: util.Position, speed: f32, hp: u32) -> Unit {
return Unit{faction, position, DEFAULT_VELOCITY, speed, hp}
}