Skip to content

Commit

Permalink
cleanup(game_object): Change split_string_into_array to get_color
Browse files Browse the repository at this point in the history
  • Loading branch information
magicaldave committed Feb 27, 2024
1 parent fa4754a commit 3f00f3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn light(
.unwrap_or_default(),
)
.expect("This cannot fail"), // Famous last words
color: split_string_into_array(
color: get_color(
&get_prop("color", entity_props),
&get_prop("Transparency", entity_props),
),
Expand All @@ -87,7 +87,7 @@ fn get_prop(prop_name: &str, prop_map: &HashMap<&String, &String>) -> String {
.to_string()
}

fn split_string_into_array(color_str: &String, alpha_str: &String) -> [u8; 4] {
fn get_color(color_str: &String, alpha_str: &String) -> [u8; 4] {
let mut array = [0; 4];
let colors: Vec<&str> = color_str.split_whitespace().collect();

Expand Down

0 comments on commit 3f00f3c

Please sign in to comment.