Easy Weekend Refactoring Java to C++
Refactoring from Java to C++
After several hard weeks of RL and coding, I am taking it easy this weekend. I started a little project to increase my fluency in C++ and how to integrate it with make. I am taking some of my adventure game classes and refactoring to C++.
Here is the Thing class as it looks in Java.
Thing.java
import java.io.Serializable;
public class Thing implements Serializable{
private String name;
private String description;
private boolean takable;
private boolean movable;
public Thing(String name, String description, boolean takable, boolean movable){
this.name = name;
this.description = description;
this.takable = takable;
this.movable = movable;
}
public String getName(){
return this.name;
}
public String getDescription(){
return this.description;
}
public boolean getTakable( ){
return this.takable;
}
public boolean getMovable( ){
return this. movable;
}
public String describe(){
return " Here is a " + this.getName() + ": It is" + this.getDescription();
}
}
Pretty straightforward. It is one of my base classes. And, here is the final look in C++. Doing it the alleged “correct” way is why there are two files, a header file and an implementation file. Using this method, I can mirror how I do it in Java with one class per file.
CI/CD Woes
How to screw up CI/CD without really trying
It begins
Yes, I am way behind on writing. RL keeps invading and I spent so much time recently trying to figure out how to create workflows that would showcase my work on an app.
I have a small Java console text adventure game I am working on. The goal is not the game, but the engine and the process of developing software. I am approaching a major point in the development. I am nearly at V1.0. I have someone that is testing the playability of the software. Having just a regular repo isn’t enough anymore. I needed something more robust. So, I started learning some of the things to do with CI/CD ( continuous integration, continuous development ).
Packaging software is not easy
Now I understand bloatware
I have not written in a while, which is not good. But, I have been so busy between RL work and my software work that I just have not had the energy or time. When I am at home, I have been working on learning how to package my adventure game. It is not as easy as it looks. I would liked to have written this post as a mini-howto on packaging via jpackage, codeberg, and github. Yeah, it’s not happening yet.