Open Elevengamer opened 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?
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
Playername | Player-ID | Fine | Last MVP |
---|---|---|---|
Elevengamer_ | 6E2DRAPKT | none | 2024-06-12 |
Event | Type | Player | Points | Rewards |
---|---|---|---|---|
Twilight Castle | Cross | StreSss | 53812 | Rank 4 |
Points | Player |
---|---|
tbc | tbc |
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.
Player:
Id
, Name
, StatePower
Events
participated in, List of MVPs
, List of Fines
Event:
EventId
, Name
, Date
, PlayerResults
(dictionary or list to store player performance)Players
, List of MVPs
MVP:
EventId
, PlayerId
, Date
, Title
Event
, Linked to Player
Fine:
FineId
, PlayerId
, Date
, Amount
, Reason
Player
Performance:
PlayerId
, EventId
, Score
, Rank
Player
, Linked to Event
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:
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>();
}
}
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>();
}
}
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;
}
}
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;
}
}
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;
}
}
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);
}
Player
, Event
, MVP
, Fine
, Performance
).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!
Build a tool to make MVPs Fair