<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C++ on The TARDIS Server Project</title><link>https://tardisgallifrey.codeberg.page/tags/c++/</link><description>Recent content in C++ on The TARDIS Server Project</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 17 Oct 2026 11:49:44 -0500</lastBuildDate><atom:link href="https://tardisgallifrey.codeberg.page/tags/c++/index.xml" rel="self" type="application/rss+xml"/><item><title>Easy Weekend Refactoring Java to C++</title><link>https://tardisgallifrey.codeberg.page/posts/refactor/</link><pubDate>Sat, 17 Oct 2026 11:49:44 -0500</pubDate><guid>https://tardisgallifrey.codeberg.page/posts/refactor/</guid><description>&lt;h2 id="refactoring-from-java-to-c"&gt;Refactoring from Java to C++&lt;/h2&gt;
&lt;p&gt;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 &lt;code&gt;make&lt;/code&gt;. I am taking some of my &lt;a href="https://github.com/tardisgallifrey/adventure"&gt;adventure game&lt;/a&gt; classes and refactoring to C++.&lt;/p&gt;
&lt;p&gt;Here is the &lt;code&gt;Thing&lt;/code&gt; class as it looks in Java.&lt;/p&gt;
&lt;h4 id="thingjava"&gt;Thing.java&lt;/h4&gt;
&lt;div class="code-block"&gt;
 &lt;button class="code-copy" type="button" hidden aria-label="Copy code to clipboard"&gt;
 &lt;span class="code-copy-label" aria-hidden="true"&gt;Copy&lt;/span&gt;
 &lt;/button&gt;
 &lt;pre tabindex="0"&gt;&lt;code&gt;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 &amp;#34; Here is a &amp;#34; + this.getName() + &amp;#34;: It is&amp;#34; + this.getDescription();
 }

}&lt;/code&gt;&lt;/pre&gt;
 &lt;/div&gt;&lt;p&gt;Pretty straightforward. It is one of my base classes. And, here is the final look in C++. Doing it the alleged &amp;ldquo;correct&amp;rdquo; 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.&lt;/p&gt;</description></item></channel></rss>