Spiel erweitert

This commit is contained in:
Torsten Schulz
2025-06-02 11:26:45 +02:00
parent a9e6c82275
commit 5029be81e9
56 changed files with 4549 additions and 436 deletions

View File

@@ -20,6 +20,7 @@ class FalukantController {
this.getDirectorProposals = this.getDirectorProposals.bind(this);
this.convertProposalToDirector = this.convertProposalToDirector.bind(this);
this.getDirectorForBranch = this.getDirectorForBranch.bind(this);
this.getAllDirectors = this.getAllDirectors.bind(this);
this.setSetting = this.setSetting.bind(this);
this.getFamily = this.getFamily.bind(this);
this.acceptMarriageProposal = this.acceptMarriageProposal.bind(this);
@@ -32,6 +33,21 @@ class FalukantController {
this.getUserHouse = this.getUserHouse.bind(this);
this.getBuyableHouses = this.getBuyableHouses.bind(this);
this.buyUserHouse = this.buyUserHouse.bind(this);
this.getPartyTypes = this.getPartyTypes.bind(this);
this.createParty = this.createParty.bind(this);
this.getParties = this.getParties.bind(this);
this.getNotBaptisedChildren = this.getNotBaptisedChildren.bind(this);
this.baptise = this.baptise.bind(this);
this.getEducation = this.getEducation.bind(this);
this.getChildren = this.getChildren.bind(this);
this.sendToSchool = this.sendToSchool.bind(this);
this.getBankOverview = this.getBankOverview.bind(this);
this.getBankCredits = this.getBankCredits.bind(this);
this.takeBankCredits = this.takeBankCredits.bind(this);
this.getNobility = this.getNobility.bind(this);
this.advanceNobility = this.advanceNobility.bind(this);
this.getHealth = this.getHealth.bind(this);
this.healthActivity = this.healthActivity.bind(this);
}
async getUser(req, res) {
@@ -324,6 +340,27 @@ class FalukantController {
}
}
async getAllDirectors(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getAllDirectors(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
}
}
async updateDirector(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { directorId, income } = req.body;
const result = await FalukantService.updateDirector(hashedUserId, directorId, income);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
}
}
async setSetting(req, res) {
try {
const { userid: hashedUserId } = req.headers;
@@ -373,6 +410,17 @@ class FalukantController {
}
}
async getChildren(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getChildren(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async sendGift(req, res) {
try {
const { userid: hashedUserId } = req.headers;
@@ -464,6 +512,165 @@ class FalukantController {
console.log(error);
}
}
async getPartyTypes(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getPartyTypes(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async createParty(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { partyTypeId, musicId, banquetteId, nobilityIds, servantRatio } = req.body;
const result = await FalukantService.createParty(hashedUserId, partyTypeId, musicId, banquetteId, nobilityIds, servantRatio);
res.status(201).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getParties(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getParties(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getNotBaptisedChildren(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getNotBaptisedChildren(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async baptise(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { characterId: childId, firstName } = req.body;
const result = await FalukantService.baptise(hashedUserId, childId, firstName);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getEducation(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getEducation(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async sendToSchool(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { item, student, studentId } = req.body;
const result = await FalukantService.sendToSchool(hashedUserId, item, student, studentId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getBankOverview(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getBankOverview(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getBankCredits(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getBankCredits(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async takeBankCredits(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { height } = req.body;
const result = await FalukantService.takeBankCredits(hashedUserId, height);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getNobility(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getNobility(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async advanceNobility(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.advanceNobility(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async getHealth(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const result = await FalukantService.getHealth(hashedUserId);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
async healthActivity(req, res) {
try {
const { userid: hashedUserId } = req.headers;
const { measureTr: activity } = req.body;
const result = await FalukantService.healthActivity(hashedUserId, activity);
res.status(200).json(result);
} catch (error) {
res.status(500).json({ error: error.message });
console.log(error);
}
}
}
export default FalukantController;