Skip to main content
deleted 6 characters in body
Source Link
Maik Semder
  • 4.7k
  • 1
  • 28
  • 24

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic- and the render logic uses-logic use the same properties, i.e. position, rotation and even health. health can be rendered as a number above the monster for instance, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the monster for instance, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update- and the render-logic use the same properties, i.e. position, rotation and even health. health can be rendered as a number above the monster for instance, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

added 16 characters in body
Source Link
Maik Semder
  • 4.7k
  • 1
  • 28
  • 24

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the pawnmonster for instance, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the pawn, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the monster for instance, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

added 17 characters in body
Source Link
Maik Semder
  • 4.7k
  • 1
  • 28
  • 24

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the pawn, there is no fundamental difference between those properties. Using MVC here

The entire question is forcingtrying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simplesimply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the pawn, there is no fundamental difference between those properties. Using MVC here is forcing a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simple belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

There is a conceptual misunderstanding in your question. positionX is to the same degree a "core" property as health or speed is. In fact, speed is nothing else than the length of the rate-of-change-vector of the position.

This conceptual wrong distinction leads to a bad design. The update logic and the render logic uses the same properties, i.e. position, rotation and even health. health can be rendered as a number above the pawn, there is no fundamental difference between those properties.

The entire question is trying to force a design pattern into data rather than the other way around, drawing a line where no such line exists.

How would you go about organizing this code into managable and separated blocks?

This data from your question:

int health
int speed
int weaponDamage
int positionX;
int positionY;
int positionZ;
int rotation;

simply belongs into 1 class. Don't over engineer, don't put unnecessary layers of complexity.

Source Link
Maik Semder
  • 4.7k
  • 1
  • 28
  • 24
Loading