isadorasophia / murder

Murder is a pixel art ECS game engine.
https://isadorasophia.com/murder/
MIT License
2.45k stars 61 forks source link

🫥 Add highlight style copy method #69

Closed heytherewill closed 7 months ago

heytherewill commented 7 months ago

This adds a copy method that is handy since CanBeHighlighted has been removed

saint11 commented 7 months ago

We probably can get away with making the highlight field an init field:

public readonly OutlineStyle HighlightStyle { get; init; } = OutlineStyle.None;

This way we can just do:

var highlighted = sprite with { HighlightStyle = OutlineStyle.Full }
heytherewill commented 7 months ago

That's even better TBH. Right now there was a bunch of copy methods down there, so I just copied them. Moving them all to allow the with { } syntax is a much better idea IMO

saint11 commented 7 months ago

Ok! I'll close this for now then. I'll move the other ones to use init in the future.