Elevengamer / Kingschoice-S690-MVP

0 stars 0 forks source link

Create Admin Tool #1

Open Elevengamer opened 4 months ago

Elevengamer commented 4 months ago

Build a tool to make MVPs Fair

Elevengamer commented 4 months ago

We should evaluate about all in look at the things that are possible for Players. So about what things we need to keep track?

Players (Name and id is best if they change names) Table for Player -> Event -> Points Table for MVPs Event -> MVP -> Date What else could be needed?

Bad behavior List Player - Date - Fine

How is decide who gets MVPs? We want to give all Players MVPs if they Compete in an Acceptable way. What should be looked at?

Players Achievements compared to what player can be able to achieve When was Players last MVP? Has the Player any Fine? Needs to be good ranked in the Event Shit MVPs where you Barely get stuff taken by those who need it less (like me) ? If you play good quite often your chnaces to get good MVPs are way better

Chess MVP: If we have 1 days of fight needs about 2 to 3 times the SP as damage If we have 2 days of fight needs about 5 times the SP as Damage If we have 3 days of fight ( rarely ) needs about 7 times the SP as Damage Else no qualification for Chess MVP.


For MVP Titles: The more often you rank good the higher your chances are You should have a good rank in that event too You should not have a fine If can win in all kinds of you are not qulified (players like me / StreSss etc) If your Statepower is higher than the average in the Alliance (currently quite bad cause average is 276 Mio) you will be less likely to get MVP

Elevengamer commented 4 months ago

Tables

Players

Playername Player-ID Fine Last MVP
Elevengamer_ 6E2DRAPKT none 2024-06-12

MVP

Event Type Player Points Rewards
Twilight Castle Cross StreSss 53812 Rank 4

Event

Realm Rivals - 2024/06

Points Player
tbc tbc
Elevengamer commented 4 months ago

Certainly! Let's break down the requirements for your Windows Forms application for tracking MVP selections in the game King's Choice. You have several tables and rules for MVP selection that we'll need to reflect in the classes and data structure of your application.

Classes Overview

  1. Player:

    • Properties: Id, Name, StatePower
    • Relationships: List of Events participated in, List of MVPs, List of Fines
  2. Event:

    • Properties: EventId, Name, Date, PlayerResults (dictionary or list to store player performance)
    • Relationships: List of Players, List of MVPs
  3. MVP:

    • Properties: EventId, PlayerId, Date, Title
    • Relationships: Linked to Event, Linked to Player
  4. Fine:

    • Properties: FineId, PlayerId, Date, Amount, Reason
    • Relationships: Linked to Player
  5. Performance:

    • Properties: PlayerId, EventId, Score, Rank
    • Relationships: Linked to Player, Linked to Event

Data Structure

We'll design the classes in a way that can handle the relationships and rules you outlined. Here's a detailed structure for each class:

Player Class

public class Player
{
    public int Id { get; set; }
    public string Name { get; set; }
    public double StatePower { get; set; }
    public List<Performance> Performances { get; set; }
    public List<MVP> Mvps { get; set; }
    public List<Fine> Fines { get; set; }

    // Constructor
    public Player(int id, string name, double statePower)
    {
        Id = id;
        Name = name;
        StatePower = statePower;
        Performances = new List<Performance>();
        Mvps = new List<MVP>();
        Fines = new List<Fine>();
    }
}

Event Class

public class Event
{
    public int EventId { get; set; }
    public string Name { get; set; }
    public DateTime Date { get; set; }
    public List<Performance> Performances { get; set; }

    // Constructor
    public Event(int eventId, string name, DateTime date)
    {
        EventId = eventId;
        Name = name;
        Date = date;
        Performances = new List<Performance>();
    }
}

MVP Class

public class MVP
{
    public int MVPId { get; set; }
    public int EventId { get; set; }
    public int PlayerId { get; set; }
    public DateTime Date { get; set; }
    public string Title { get; set; }

    // Constructor
    public MVP(int mvpId, int eventId, int playerId, DateTime date, string title)
    {
        MVPId = mvpId;
        EventId = eventId;
        PlayerId = playerId;
        Date = date;
        Title = title;
    }
}

Fine Class

public class Fine
{
    public int FineId { get; set; }
    public int PlayerId { get; set; }
    public DateTime Date { get; set; }
    public double Amount { get; set; }
    public string Reason { get; set; }

    // Constructor
    public Fine(int fineId, int playerId, DateTime date, double amount, string reason)
    {
        FineId = fineId;
        PlayerId = playerId;
        Date = date;
        Amount = amount;
        Reason = reason;
    }
}

Performance Class

public class Performance
{
    public int PlayerId { get; set; }
    public int EventId { get; set; }
    public double Score { get; set; }
    public int Rank { get; set; }

    // Constructor
    public Performance(int playerId, int eventId, double score, int rank)
    {
        PlayerId = playerId;
        EventId = eventId;
        Score = score;
        Rank = rank;
    }
}

Data Relationships and Logic

MVP Selection Criteria

Here’s a possible method in the Event class to select MVP based on your rules:

public MVP SelectMVP()
{
    var eligiblePlayers = Performances.Where(p => 
        !p.Player.Fines.Any() && 
        p.Rank <= 10 && // Assuming rank 10 is a good rank
        p.Score >= GetMinimumRequiredScoreForEvent(p.EventId)
    ).OrderByDescending(p => p.Score).ToList();

    var mvpPlayer = eligiblePlayers.FirstOrDefault();
    if (mvpPlayer != null)
    {
        var mvp = new MVP(GenerateNewMVPId(), mvpPlayer.EventId, mvpPlayer.PlayerId, DateTime.Now, "Event MVP");
        return mvp;
    }

    return null;
}

private double GetMinimumRequiredScoreForEvent(int eventId)
{
    // Logic based on event type and duration
    return 100; // Example minimum score
}

private int GenerateNewMVPId()
{
    // Logic to generate unique MVP ID
    return new Random().Next(1, 1000);
}

Summary

This structure gives you a clear way to track player performance and select MVPs based on predefined rules. You can expand this by integrating more complex business rules and UI components in your Windows Forms application.

If you need further help with specific parts of the implementation or additional features, feel free to ask!