C# - C Sharp: Practical 13: Football Management System
FOOTBALL MANAGEMENT SYSTEM
1. Create interface IPlayer that has some properties and methods:
Properties:
- Name ( string)
- Age (int, 0 < Age < 40)
- Attack (int, 0 < Attack < 100)
- Defense (int, 0 < Defense < 100)
- Stamina (int, 0 < Stamina < 100)
- Speed (int, 0 < Speed < 100)
- Power (int, 0 < Power < 100)
Methods:
- Void GetInfo()
2. Create class Player implements interface Iplayer
- Implements GetInfo method to print to the console the Name, Age and average point of player :( Attack + Defense +Stamina + Speed + Power) / 5
3. Create delegate ActionDelegate
- void ActionDelegate();
4. Create generic class Club<T> implement interface IEnumerable<T> which T is interface IPlayer or T is a class that implements interface IPlayer.
Event:
- void ActionDelegate AttackEvent;
- void ActionDelegate DefenseEvent;
Methods:
- void Add(T t):
Add player to the list.
If player has the average point above 80, register method GetInfo of player to AttackEvent.
If player has the average point above 60 and less than 80, register method GetInfo of player to DefenseEvent.
5. Create Menu:
1. Create new Player
2. List all players
3. Search player by Name
4. Raise Attack Event
5. Raise Defense Event
6. Exit