deprecation warnung hinzugefügt
in der Hoffnung das der Cluade Agent das sieht und beachtet
This commit is contained in:
@@ -163,6 +163,8 @@ func splitSkills(object []models.SkFertigkeit) ([]models.SkFertigkeit, []models.
|
||||
return normSkills, innateSkills, categories
|
||||
}
|
||||
|
||||
// GetLearnSkillCostOld is deprecated. Use GetLearnSkillCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
func GetLearnSkillCostOld(c *gin.Context) {
|
||||
// Get the character ID from the request
|
||||
charID := c.Param("id")
|
||||
@@ -197,6 +199,8 @@ func GetLearnSkillCostOld(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, cost)
|
||||
}
|
||||
|
||||
// GetLearnSpellCostOld is deprecated. Use GetLearnSpellCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
func GetLearnSpellCostOld(c *gin.Context) {
|
||||
// Get the character ID from the request
|
||||
charID := c.Param("id")
|
||||
@@ -580,6 +584,8 @@ type LearnSpellRequest struct {
|
||||
Notes string `json:"notes,omitempty"`
|
||||
}
|
||||
|
||||
// calculateMultiLevelCostsOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// calculateMultiLevelCostsOld berechnet die Kosten für mehrere Level-Verbesserungen mit gsmaster.GetLernCostNextLevel
|
||||
func calculateMultiLevelCostsOld(character *models.Char, skillName string, currentLevel int, levelsToLearn []int, rewardType string, usePP, useGold int) (*models.LearnCost, error) {
|
||||
if len(levelsToLearn) == 0 {
|
||||
@@ -671,6 +677,8 @@ func calculateMultiLevelCostsOld(character *models.Char, skillName string, curre
|
||||
return totalCost, nil
|
||||
}
|
||||
|
||||
// getCharacterClassOld is deprecated. Use character.Klasse directly or appropriate database lookups.
|
||||
// This function provides backwards compatibility for character class access.
|
||||
// getCharacterClassOld gibt die Charakterklassen-Abkürzung zurück
|
||||
func getCharacterClassOld(character *models.Char) string {
|
||||
if len(character.Typ) > 3 {
|
||||
@@ -679,6 +687,8 @@ func getCharacterClassOld(character *models.Char) string {
|
||||
return character.Typ
|
||||
}
|
||||
|
||||
// LearnSkillOld is deprecated. Use LearnSkill instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// LearnSkillOld lernt eine neue Fertigkeit und erstellt Audit-Log-Einträge
|
||||
func LearnSkillOld(c *gin.Context) {
|
||||
charID := c.Param("id")
|
||||
@@ -885,6 +895,8 @@ func LearnSkillOld(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
// ImproveSkillOld is deprecated. Use ImproveSkill instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// ImproveSkillOld verbessert eine bestehende Fertigkeit und erstellt Audit-Log-Einträge
|
||||
func ImproveSkillOld(c *gin.Context) {
|
||||
// Verwende gsmaster.LernCostRequest direkt
|
||||
@@ -1108,6 +1120,8 @@ func ImproveSkillOld(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
// LearnSpellOld is deprecated. Use LearnSpell instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// LearnSpellOld lernt einen neuen Zauber und erstellt Audit-Log-Einträge
|
||||
func LearnSpellOld(c *gin.Context) {
|
||||
charID := c.Param("id")
|
||||
@@ -1180,6 +1194,8 @@ func LearnSpellOld(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// GetRewardTypesOld is deprecated. Use GetRewardTypes instead.
|
||||
// This function provides hardcoded reward type mappings.
|
||||
// GetRewardTypesOld liefert verfügbare Belohnungsarten für ein bestimmtes Lernszenario
|
||||
func GetRewardTypesOld(c *gin.Context) {
|
||||
characterID := c.Param("id")
|
||||
@@ -1448,6 +1464,8 @@ func GetAvailableSpellsNewSystem(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// GetAvailableSkillsOld is deprecated. Use GetAvailableSkillsNewSystem instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// GetAvailableSkillsOld gibt alle verfügbaren Fertigkeiten mit Lernkosten zurück
|
||||
func GetAvailableSkillsOld(c *gin.Context) {
|
||||
characterID := c.Param("id")
|
||||
@@ -1515,6 +1533,8 @@ func GetAvailableSkillsOld(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// calculateSkillLearningCostsOld is deprecated. Use calculateSkillLearnCostNewSystem instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// calculateSkillLearningCostsOld berechnet die EP- und Goldkosten für das Lernen einer Fertigkeit mit GetLernCostNextLevel
|
||||
func calculateSkillLearningCostsOld(skill models.Skill, character models.Char, rewardType string) (int, int) {
|
||||
// Erstelle LernCostRequest für das Lernen (Level 0 -> 1)
|
||||
|
||||
@@ -677,7 +677,8 @@ func getCurrentSkillLevel(character *models.Char, skillName, skillType string) i
|
||||
return -1
|
||||
}
|
||||
|
||||
// Helper function to calculate single cost
|
||||
// calculateSingleCostOld is deprecated. Use calculateSkillLearnCostNewSystem or calculateSpellLearnCostNewSystem instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
func calculateSingleCostOld(character *models.Char, request *SkillCostRequest) (*models.LearnCost, *models.LearnCost, *skillInfo, error) {
|
||||
var cost *models.LearnCost
|
||||
var err error
|
||||
@@ -687,19 +688,19 @@ func calculateSingleCostOld(character *models.Char, request *SkillCostRequest) (
|
||||
case request.Action == "learn" && request.Type == "skill":
|
||||
cost, err = gsmaster.CalculateDetailedSkillLearningCostOld(request.Name, character.Typ)
|
||||
if err == nil {
|
||||
info = getSkillInfoOld(request.Name, request.Type)
|
||||
info = GetSkillInfoCategoryAndDifficultyOld(request.Name, request.Type)
|
||||
}
|
||||
|
||||
case request.Action == "improve" && request.Type == "skill":
|
||||
cost, err = gsmaster.CalculateDetailedSkillImprovementCostOld(request.Name, character.Typ, request.CurrentLevel)
|
||||
if err == nil {
|
||||
info = getSkillInfoOld(request.Name, request.Type)
|
||||
info = GetSkillInfoCategoryAndDifficultyOld(request.Name, request.Type)
|
||||
}
|
||||
|
||||
case request.Action == "improve" && request.Type == "weapon":
|
||||
cost, err = gsmaster.CalculateDetailedSkillImprovementCostOld(request.Name, character.Typ, request.CurrentLevel)
|
||||
if err == nil {
|
||||
info = getSkillInfoOld(request.Name, request.Type)
|
||||
info = GetSkillInfoCategoryAndDifficultyOld(request.Name, request.Type)
|
||||
}
|
||||
|
||||
case request.Action == "learn" && request.Type == "spell":
|
||||
@@ -908,7 +909,9 @@ type skillInfo struct {
|
||||
Difficulty string
|
||||
}
|
||||
|
||||
func getSkillInfoOld(skillName, skillType string) skillInfo {
|
||||
// GetSkillInfoCategoryAndDifficultyOld is deprecated. Use models.GetSkillCategoryAndDifficulty instead.
|
||||
// This function uses the old hardcoded skill categorization system.
|
||||
func GetSkillInfoCategoryAndDifficultyOld(skillName, skillType string) skillInfo {
|
||||
var skill models.Skill
|
||||
if err := skill.First(skillName); err != nil {
|
||||
return skillInfo{Category: "unknown", Difficulty: "unknown"}
|
||||
|
||||
@@ -322,6 +322,8 @@ func GetLearningCosts() *LearningCostsTable {
|
||||
return learningCosts
|
||||
}
|
||||
|
||||
// CalculateSkillLearningCostsOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// CalculateSkillLearningCostsOld berechnet die Kosten für das Lernen einer Fertigkeit
|
||||
func CalculateSkillLearningCostsOld(characterClass, category, difficulty string) (*SkillCostResult, error) {
|
||||
//Überprüfe ob die tabelle vorhanden ist in der die EP-Kosten pro LE for die einzelnen Kategorien für jede Charakterklasse definiert sind
|
||||
@@ -373,6 +375,8 @@ func CalculateSkillLearningCostsOld(characterClass, category, difficulty string)
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CalculateSpellLearningCostsOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// CalculateSpellLearningCostsOld berechnet die Kosten für das Lernen eines Zaubers
|
||||
func CalculateSpellLearningCostsOld(characterClass, spellSchool string, leNeeded int) (*SkillCostResult, error) {
|
||||
if learningCosts.SpellEPPerLE == nil {
|
||||
@@ -438,6 +442,8 @@ type SkillCostResultNew struct {
|
||||
Details map[string]interface{} `json:"details"`
|
||||
}
|
||||
|
||||
// CalculateDetailedSkillLearningCostOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// CalculateDetailedSkillLearningCostOld berechnet die Kosten für das Lernen einer Fertigkeit mit Details
|
||||
func CalculateDetailedSkillLearningCostOld(skillName, characterClass string) (*models.LearnCost, error) {
|
||||
// Fallback-Werte für Skills ohne definierte Kategorie/Schwierigkeit
|
||||
@@ -458,7 +464,8 @@ func CalculateDetailedSkillLearningCostOld(skillName, characterClass string) (*m
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CalculateDetailedSkillImprovementCostOld berechnet die Kosten für die Verbesserung einer Fertigkeit
|
||||
// CalculateDetailedSkillImprovementCostOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
func CalculateDetailedSkillImprovementCostOld(skillName, characterClass string, currentLevel int) (*models.LearnCost, error) {
|
||||
// Fallback-Werte für Skills ohne definierte Kategorie/Schwierigkeit
|
||||
category := GetDefaultCategoryOld(skillName)
|
||||
@@ -490,6 +497,8 @@ func CalculateDetailedSkillImprovementCostOld(skillName, characterClass string,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CalculateDetailedSpellLearningCostOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// CalculateDetailedSpellLearningCostOld berechnet die Kosten für das Lernen eines Zaubers
|
||||
func CalculateDetailedSpellLearningCostOld(spellName, characterClass string) (*models.LearnCost, error) {
|
||||
// Standard-Zauberschule bestimmen
|
||||
@@ -645,6 +654,8 @@ func GetAvailableSkillCategories(skillName string) []SkillCategoryOption {
|
||||
}
|
||||
}
|
||||
|
||||
// GetDefaultCategoryOld is deprecated. Use models.GetSkillCategoryAndDifficulty instead.
|
||||
// This function uses the old hardcoded skill categorization system.
|
||||
// GetDefaultCategoryOld gibt die erste (bevorzugte) Kategorie für eine Fertigkeit zurück
|
||||
func GetDefaultCategoryOld(skillName string) string {
|
||||
// WICHTIG: Wir verwenden bewusst die erste gefundene Kategorie als Standard.
|
||||
@@ -714,6 +725,8 @@ func GetDifficulty(skillName string, category string) string {
|
||||
return GetDefaultDifficultyOld(skillName)
|
||||
}
|
||||
|
||||
// GetDefaultDifficultyOld is deprecated. Use models.GetSkillCategoryAndDifficulty instead.
|
||||
// This function uses the old hardcoded skill categorization system.
|
||||
// GetDefaultDifficultyOld gibt die erste (bevorzugte) Schwierigkeit für eine Fertigkeit zurück
|
||||
func GetDefaultDifficultyOld(skillName string) string {
|
||||
// WICHTIG: Korrespondiert mit getDefaultCategory() - verwendet die Schwierigkeit
|
||||
@@ -791,6 +804,8 @@ func GetDefaultDifficultyOld(skillName string) string {
|
||||
return "normal"
|
||||
}
|
||||
|
||||
// getDefaultSpellSchoolOld is deprecated. Use the new database-based spell categorization system instead.
|
||||
// This function uses hardcoded spell-to-school mapping.
|
||||
// getDefaultSpellSchoolOld gibt eine Standard-Zauberschule für einen Zauber zurück
|
||||
func getDefaultSpellSchoolOld(spellName string) string {
|
||||
// Vereinfachte Zuordnung von Zauber zu Schulen
|
||||
@@ -815,6 +830,8 @@ func getDefaultSpellSchoolOld(spellName string) string {
|
||||
return "Verändern"
|
||||
}
|
||||
|
||||
// GetClassAbbreviationOld is deprecated. Use standardized class names or database lookups instead.
|
||||
// This function uses hardcoded class name mapping.
|
||||
// GetClassAbbreviationOld konvertiert Charakterklassen-Vollnamen zu Abkürzungen
|
||||
func GetClassAbbreviationOld(characterClass string) string {
|
||||
// Mapping von Vollnamen zu Abkürzungen
|
||||
|
||||
@@ -491,6 +491,8 @@ var learningCostsData = &LearningCostsTable2{
|
||||
},
|
||||
}
|
||||
|
||||
// GetSkillCategoryOld is deprecated. Use models.GetSkillCategoryAndDifficulty instead.
|
||||
// This function uses the old hardcoded skill categorization system.
|
||||
func GetSkillCategoryOld(skillName string) string {
|
||||
|
||||
for category, difficulties := range learningCostsData.ImprovementCost {
|
||||
@@ -503,6 +505,8 @@ func GetSkillCategoryOld(skillName string) string {
|
||||
return "Unbekannt"
|
||||
}
|
||||
|
||||
// GetSkillDifficultyOld is deprecated. Use models.GetSkillCategoryAndDifficulty instead.
|
||||
// This function uses the old hardcoded skill categorization system.
|
||||
func GetSkillDifficultyOld(category string, skillName string) string {
|
||||
// Wenn eine Kategorie angegeben ist, suche nur in dieser Kategorie
|
||||
if category != "" {
|
||||
@@ -555,6 +559,8 @@ func GetSpellInfoNewSystem(spellName string) (string, int, error) {
|
||||
return spell.Category, spell.Stufe, nil
|
||||
}
|
||||
|
||||
// GetSpecializationOld is deprecated. Use appropriate character data access methods instead.
|
||||
// This function is a placeholder that should not be used in production.
|
||||
// GetSpecializationOld returns the specialization school for a character (placeholder)
|
||||
// This should be implemented to get the actual specialization from character data
|
||||
func GetSpecializationOld(characterID string) string {
|
||||
@@ -563,6 +569,8 @@ func GetSpecializationOld(characterID string) string {
|
||||
return "Beherrschen"
|
||||
}
|
||||
|
||||
// findBestCategoryForSkillImprovementOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// findBestCategoryForSkillImprovementOld findet die Kategorie mit den niedrigsten EP-Kosten für eine Fertigkeit
|
||||
func findBestCategoryForSkillImprovementOld(skillName, characterClass string, level int) (string, string, error) {
|
||||
classKey := characterClass
|
||||
@@ -612,6 +620,8 @@ func findBestCategoryForSkillImprovementOld(skillName, characterClass string, le
|
||||
return bestOption.category, bestOption.difficulty, nil
|
||||
}
|
||||
|
||||
// FindBestCategoryForSkillLearningOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function uses the old hardcoded learning cost data.
|
||||
// FindBestCategoryForSkillLearningOld findet die Kategorie mit den niedrigsten EP-Kosten für das Lernen einer Fertigkeit
|
||||
func FindBestCategoryForSkillLearningOld(skillName, characterClass string) (string, string, error) {
|
||||
classKey := characterClass
|
||||
@@ -659,6 +669,8 @@ func FindBestCategoryForSkillLearningOld(skillName, characterClass string) (stri
|
||||
return bestOption.category, bestOption.difficulty, nil
|
||||
}
|
||||
|
||||
// CalcSkillLernCostOld is deprecated. Use CalcSkillLernCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
func CalcSkillLernCostOld(costResult *SkillCostResultNew, reward *string) error {
|
||||
// Berechne die Lernkosten basierend auf den aktuellen Werten im costResult
|
||||
// Hier sollte die Logik zur Berechnung der Lernkosten implementiert werden
|
||||
@@ -709,6 +721,8 @@ func CalcSkillLernCostOld(costResult *SkillCostResultNew, reward *string) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// CalcSkillImproveCostOld is deprecated. Use CalcSkillImproveCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// CalcSkillImproveCostOld berechnet die Kosten für die Verbesserung einer Fertigkeit
|
||||
func CalcSkillImproveCostOld(costResult *SkillCostResultNew, currentLevel int, reward *string) error {
|
||||
// Für Skill-Verbesserung könnten die Kosten vom aktuellen Level abhängen
|
||||
@@ -775,6 +789,8 @@ func CalcSkillImproveCostOld(costResult *SkillCostResultNew, currentLevel int, r
|
||||
return nil
|
||||
}
|
||||
|
||||
// CalcSpellLernCostOld is deprecated. Use CalcSpellLernCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// CalcSpellLernCostOld berechnet die Kosten für das Erlernen eines Zaubers
|
||||
func CalcSpellLernCostOld(costResult *SkillCostResultNew, reward *string) error {
|
||||
// Für Zauber verwenden wir eine ähnliche Logik wie für Skills
|
||||
@@ -840,6 +856,8 @@ func CalcSpellLernCostOld(costResult *SkillCostResultNew, reward *string) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetLernCostNextLevelOld is deprecated. Use GetLernCostNextLevel instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
func GetLernCostNextLevelOld(request *LernCostRequest, costResult *SkillCostResultNew, reward *string, level int, characterRasse string) error {
|
||||
// Diese Funktion berechnet die Kosten für das Erlernen oder Verbessern einer Fertigkeit oder eines Zaubers
|
||||
// abhängig von der Aktion (learn/improve) und der Belohnung.
|
||||
|
||||
@@ -69,6 +69,8 @@ var AllowedGroups = map[CharClass]map[SkillGroup]bool}
|
||||
|
||||
var Config LevelConfig // holds all loaded data
|
||||
|
||||
// loadLevelingConfigOld is deprecated. Use the new database-based learning cost system instead.
|
||||
// This function loads data from static JSON files.
|
||||
func loadLevelingConfigOld(opts ...string) error {
|
||||
// Adjust path as needed
|
||||
filePath := "../testdata/leveldata.json"
|
||||
@@ -89,6 +91,8 @@ func loadLevelingConfigOld(opts ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CalculateSpellLearnCostOld is deprecated. Use CalcSpellLernCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// CalculateSpellLearnCostOld combines SpellLearnCost with SpellEPPerSchoolByClass
|
||||
func CalculateSpellLearnCostOld(spell string, class string) (int, error) {
|
||||
if Config.AllowedSchools == nil {
|
||||
@@ -128,6 +132,8 @@ func CalculateSpellLearnCostOld(spell string, class string) (int, error) {
|
||||
return totalEP, nil
|
||||
}
|
||||
|
||||
// CalculateSkillLearnCostOld is deprecated. Use CalcSkillLernCost instead.
|
||||
// This function uses the old hardcoded learning cost system.
|
||||
// CalculateSkillLearnCostOld: erstmalige Kosten in EP
|
||||
// Then refer to Config in your calculations:
|
||||
func CalculateSkillLearnCostOld(skill string, class string) (int, error) {
|
||||
|
||||
@@ -321,8 +321,8 @@ func GetSkillCategoryAndDifficultyNewSystem(skillName string, classCode string)
|
||||
return &results[0], nil
|
||||
}
|
||||
|
||||
// GetSkillInfoForCategoryAndDifficulty holt die Informationen für eine spezifische Kategorie/Schwierigkeit
|
||||
func GetSkillInfoForCategoryAndDifficulty(skillName, category, difficulty, classCode string) (*SkillLearningInfo, error) {
|
||||
// GetSkillInfoCategoryAndDifficultyNewSystem holt die Informationen für eine spezifische Kategorie/Schwierigkeit
|
||||
func GetSkillInfoCategoryAndDifficultyNewSystem(skillName, category, difficulty, classCode string) (*SkillLearningInfo, error) {
|
||||
var result SkillLearningInfo
|
||||
|
||||
err := database.DB.Raw(`
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user