cpp port

fukurou

the supreme coder
ADMIN
.h
C++:
#ifndef ALGORITHM_H
#define ALGORITHM_H

#include <vector>

class Algorithm {
private:
    std::vector<void*> algParts; // Using void* to avoid details about Mutatable

public:
    // Constructors
    Algorithm(const std::vector<void*>& parts);
    Algorithm(const void* parts[], size_t count);

    // Getters
    const std::vector<void*>& getAlgParts() const;
    size_t getSize() const;
};

#endif
cpp
C++:
#include "Algorithm.h"

// Constructor with vector
Algorithm::Algorithm(const std::vector<void*>& parts)
    : algParts(parts) {}

// Constructor with array
Algorithm::Algorithm(const void* parts[], size_t count)
    : algParts(parts, parts + count) {}

// Getter for algParts
const std::vector<void*>& Algorithm::getAlgParts() const {
    return algParts;
}

// Getter for size
size_t Algorithm::getSize() const {
    return algParts.size();
}
 

fukurou

the supreme coder
ADMIN
.h
C++:
#ifndef KOKORO_H
#define KOKORO_H

#include <string>
#include <unordered_map>

using namespace std;

class Kokoro {
private:
    string emot;

public:
    unordered_map<string, string> toHeart;

    // Constructor
    Kokoro();

    // Getters and Setters
    const string& getEmot() const;
    void setEmot(const string& emot);
};

#endif

cpp
C++:
#include "Kokoro.h"

// Constructor
Kokoro::Kokoro()
    : emot("") {}

// Getter for emot
const string& Kokoro::getEmot() const {
    return emot;
}

// Setter for emot
void Kokoro::setEmot(const string& emot) {
    this->emot = emot;
}
 

fukurou

the supreme coder
ADMIN
Java:
package LivinGrimoire;

import java.util.ArrayList;
import java.util.List;

public class Skill {
    protected Kokoro kokoro = null;  // Consciousness reference for interskill communication
    protected Algorithm outAlg = null;  // Skill output algorithm
    protected int outpAlgPriority = -1;  // Priority level (1-5)

    public Skill() { super(); }

    public void input(String ear, String skin, String eye) { }

    public void output(Neuron noiron) {
        if (outAlg != null) {
            noiron.insertAlg(this.outpAlgPriority, outAlg);
            outpAlgPriority = -1;
            outAlg = null;
        }
    }

    public void setKokoro(Kokoro kokoro) {
        this.kokoro = kokoro;
    }

    protected void setVerbatimAlg(int priority, String... sayThis) {
        List<Mutatable> algList = new ArrayList<>();
        algList.add(new APVerbatim(List.of(sayThis)));
        this.outAlg = new Algorithm(algList);
        this.outpAlgPriority = priority;
    }

    protected void setSimpleAlg(String... sayThis) {
        List<Mutatable> algList = new ArrayList<>();
        algList.add(new APVerbatim(List.of(sayThis)));
        this.outAlg = new Algorithm(algList);
        this.outpAlgPriority = 4;
    }

    protected void setVerbatimAlgFromList(int priority, List<String> sayThis) {
        List<Mutatable> algList = new ArrayList<>();
        algList.add(new APVerbatim(sayThis));
        this.outAlg = new Algorithm(algList);
        this.outpAlgPriority = priority;
    }

    public void algPartsFusion(int priority, List<Mutatable> algParts) {
        this.outAlg = new Algorithm(algParts);
        this.outpAlgPriority = priority;
    }

    public Boolean pendingAlgorithm() {
        return this.outAlg != null;
    }

    public String skillNotes(String param) {
        return "notes unknown";
    }
}
 
Top