He/Him | Hu/En/some Jp | ASD | Bi | C/C++/D/C#/Java

  • 22 Posts
  • 304 Comments
Joined 2 years ago
cake
Cake day: March 16th, 2024

help-circle
  • crying chudjak “Sob…sob… YOU’RE MISSING OUT ON SO MUCH!! You’re even ruining open source by forcing developers to make their things more usable for normies instead of fixing bugs! I’m so frustrated! I used to remember the time when I knew all the Linux users, hazing newbie users, now its full with woke people pushing Rust on everyone!”








  • Now someone needs to make it an entity component system!

    Attempt 1:

    public struct Entity {
      bool isDog : 1;
      bool isAircraftCarrier : 1;
      bool isFlea : 1;
      bool canFlyInAir : 1;
      ubyte opt_numOfAircrafts : 4;
      int entityID;
      int opt_parentID;
      static Entity createDog(int entityID) {
        Entity result;
        result.isDog = true;
        result.entityID = entityID;
        return result;
      }
      static Entity createFlea(int entityID) {
        Entity result;
        result.isFlea = true;
        result.canFlyInAir = true;
        result.entityID = entityID;
        return result;
      }
      void addAirCraft(ref Entity aircraft) {
        if (aircraft.canFlyInAir && this.isAircraftCarrier) {
          aircraft.opt_parentID = this.entityID;
          this.opt_numOfAircrafts++;
        }
      }
      void woof() {
        if (isDog) {
          if (isAircraftCarrier) writeln("I'm a motherfucking aircraft carrier");
          else writeln("Woof!");
        }
      }
    }
    
    void main() {
      Entity dog = Entity.createDog(1);
      Entity flea = Entity.createFlea(2);
      dog.woof();
      dog.isAircraftCarrier = true;
      dog.addAirCraft(flea);
      dog.woof();
    }