Skip to content

Commit

Permalink
style: apply linter
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 7, 2024
1 parent 6e2c1d6 commit ece63f5
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ struct Collider {
Collider(Math::Vector2f nsize) : _size(nsize) {}
Collider(const Collider &other) : _size(other._size) {}

Collider& operator=(const Collider& other) {
Collider &operator=(const Collider &other)
{
if (this != &other)
_size = other._size;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ struct Control {
Control(const Control &other)
: up(other.up), down(other.down), left(other.left), right(other.right), shoot(other.shoot){};

Control& operator=(const Control& other) {
Control &operator=(const Control &other)
{
if (this != &other)
{
up = other.up;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ struct Movable {
: velocity(velocity), acceleration(acceleration){};
Movable(const Movable &other) : velocity(other.velocity), acceleration(other.acceleration){};

Movable& operator=(const Movable& other) {
Movable &operator=(const Movable &other)
{
if (this != &other)
{
velocity = other.velocity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ struct RigidBody {
: mass(mass), restitution(restitution), friction(friction), gravityScale(gravityScale), isGravityAffected(true),
isKinematic(false){};

RigidBody& operator=(const RigidBody& other) {
RigidBody &operator=(const RigidBody &other)
{
if (this != &other)
{
mass = other.mass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct Transform {
: position(position), scale(scale), rotation(rotation){};
Transform(const Transform &other) : position(other.position), scale(other.scale), rotation(other.rotation){};

Transform& operator=(const Transform& other) {
Transform &operator=(const Transform &other)
{
if (this != &other)
{
position = other.position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ struct Child {
Child(const std::string &nname) : name(nname) {}
Child(const Child &other) : name(other.name) {}

Child &operator=(const Child &other) {
Child &operator=(const Child &other)
{
if (this != &other)
name = other.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ struct Evolve {
Evolve(const std::string &nname) : name(nname) {}
Evolve(const Evolve &other) : name(other.name) {}

Evolve &operator=(const Evolve &other) {
Evolve &operator=(const Evolve &other)
{
if (this != &other)
name = other.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ struct Health {
: currentHealth(other.currentHealth), maxHealth(other.maxHealth), shield(other.shield),
maxShield(other.maxShield){};

Health& operator=(const Health& other) {
Health &operator=(const Health &other)
{
if (this != &other)
{
currentHealth = other.currentHealth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ struct Id {
Id(std::size_t id) : id(id) {}
Id(const Id &other) : id(other.id) {}

Id &operator=(const Id &other) {
Id &operator=(const Id &other)
{
if (this != &other)
id = other.id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct NetworkEvent {
NetworkEvent(const NetworkEvent &other) : events(other.events){};
NetworkEvent(const std::vector<unsigned short> &events) : events(events){};

NetworkEvent &operator=(const NetworkEvent &other) {
NetworkEvent &operator=(const NetworkEvent &other)
{
if (this != &other)
events = other.events;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct NetworkIp {
NetworkIp(std::string ip) : ip(ip) {}
NetworkIp(const NetworkIp &other) : ip(other.ip) {}

NetworkIp &operator=(const NetworkIp &other) {
NetworkIp &operator=(const NetworkIp &other)
{
if (this != &other)
ip = other.ip;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct Parent {
Parent(const std::size_t &entity) : entity(entity) {}
Parent(const Parent &other) : entity(other.entity) {}

Parent &operator=(const Parent &other) {
Parent &operator=(const Parent &other)
{
if (this != &other)
entity = other.entity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct Spawned {
Spawned(bool spawed) : has_spawned(spawed) {}
Spawned(const Spawned &other) : has_spawned(other.has_spawned) {}

Spawned& operator=(const Spawned& other) {
Spawned &operator=(const Spawned &other)
{
if (this != &other)
has_spawned = other.has_spawned;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ struct Tag {
Tag(const std::string &ntag) : tag(ntag) {}
Tag(const Tag &other) : tag(other.tag) {}

Tag &operator=(const Tag &other) {
Tag &operator=(const Tag &other)
{
if (this != &other)
tag = other.tag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct Template {
Template(const std::string &nname) : name(nname) {}
Template(const Template &other) : name(other.name) {}

Template &operator=(const Template &other) {
Template &operator=(const Template &other)
{
if (this != &other)
name = other.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ struct Weapon {
Weapon(const Weapon &other) = default;
Weapon(std::size_t dmg, float rate, std::size_t lvl) : damage(dmg), fireRate(rate), level(lvl){};

Weapon &operator=(const Weapon &other) {
Weapon &operator=(const Weapon &other)
{
if (this != &other)
{
damage = other.damage;
Expand Down

0 comments on commit ece63f5

Please sign in to comment.