d
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
15
v4/ctx.h
Normal file
15
v4/ctx.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifndef ctx_HEADER
|
||||
#define ctx_HEADER
|
||||
|
||||
template <class T> class ctx_Controller {
|
||||
T context;
|
||||
|
||||
ctx_Controller(const T &c) {
|
||||
context = c;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // ctx_HEADER
|
||||
@@ -1,6 +1,6 @@
|
||||
import copy
|
||||
|
||||
class Controller:
|
||||
class ctx_Controller:
|
||||
def __init__(self, c):
|
||||
self.callbacks = []
|
||||
self.context = c
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from cli import *
|
||||
from cli_test import *
|
||||
from ctx import *
|
||||
from llm_test import *
|
||||
from llm_test_Python import *
|
||||
from memory_test import *
|
||||
from Controller import *
|
||||
import sys
|
||||
|
||||
print(llm_test_Python_copyByValue())
|
||||
@@ -35,7 +35,7 @@ print(cli_test_reportMatchedItems())
|
||||
print(cli_test_reportMismatchedItems())
|
||||
print(cli_test_reportVictory())
|
||||
|
||||
ctrl = Controller(memory_createContext())
|
||||
ctrl = ctx_Controller(memory_createContext())
|
||||
ctrl.registerFunctions([
|
||||
cli_exit,
|
||||
cli_goOn,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
#include "memory_Context.h"
|
||||
|
||||
|
||||
template <typename T> T memory_Context::field(const std::string &fieldName) {
|
||||
if (fieldName == "didLaunch") {
|
||||
return didLaunch;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename T> void memory_Context::setField(const std::string &fieldName, T value) {
|
||||
if (fieldName == "didLaunch") {
|
||||
didLaunch = value;
|
||||
}
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
memory_Context memory_createContext() {
|
||||
return memory_Context();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
|
||||
#ifndef memory_Context_HEADER
|
||||
#define memory_Context_HEADER
|
||||
@@ -11,6 +12,7 @@ struct memory_Context {
|
||||
std::string input = "";
|
||||
std::vector<int> hiddenItems;
|
||||
std::vector<int> mismatchedItems;
|
||||
std::string recentField = "none";
|
||||
std::string outputGoOn = "";
|
||||
std::string outputGreeting = "";
|
||||
std::string outputHelp = "";
|
||||
@@ -20,10 +22,12 @@ struct memory_Context {
|
||||
std::string outputVictory = "";
|
||||
std::map<int, int> playfieldItems;
|
||||
int playfieldSize = 0;
|
||||
std::string recentField = "none";
|
||||
int selectedId = -1;
|
||||
std::vector<int> selectedItems;
|
||||
bool victory = false;
|
||||
|
||||
template <typename T> T field(const std::string &fieldName);
|
||||
template <typename T> void setField(const std::string &fieldName, T value);
|
||||
};
|
||||
|
||||
memory_Context memory_createContext();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from Function import *
|
||||
|
||||
def includes():
|
||||
return """#include <map>
|
||||
return """
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ctx.h"
|
||||
#include "llm.h"
|
||||
#include "memory_Context.h"
|
||||
#include "main.h"
|
||||
|
||||
Reference in New Issue
Block a user