game of f     tball

- Sparta, 13
Rohan, Rupanshu, Sumith, Yogesh

game of football?

One can imagine that simulating a football game and coding it up, will be a huge object-oriented problem. There are more than one ways in which various objects interface i.e. ball, players, referee, strategies, etc.
 

In the software engineering world consistent classification of patterns for common design problems are provided.

And a football match requires more than one.
Our goal was to get close to Fifa Manager, we'll brief on how close we got.

The Ball

The design pattern applied to handle this entity is Observer pattern.
 

"When the position of the ball changes all players should be notified straight away."

Hence the name, all the player objects are "observing" the ball.

UML Diagram

Screenshot

Check out the code for that implemets Observer Pattern, in our GitHub repo, here.

The Players

The design pattern applied to handle this entity is Decorator pattern.
 

"A player in a team should have additional responsibilities, like Forward, Defender etc, that can be assigned during runtime. "

Hence the name, you are "decorating" the player objects with various responsibilities as inheritance is no longer an option.

UML Diagram

Screenshot

Check out the code for that implemets Decorator Pattern, in our GitHub repo, here.

The Team Strategy

The design pattern applied to handle this entity is Strategy pattern.
 

"When the game is in progress, the end user can change the strategy of his team(e.g. from Attack to Defend)."

Hence the name.

UML Diagram

Screenshot

Check out the code for that implemets Strategy Pattern, in our GitHub repo,

here.

Simulation Algorithm

A trait-based simulation algorithm was implemented to simulate attack.

Learning points

  • Read about various design patterns and implemented the same.
  • Implemented the whole system in Python.

Scope for improvement

  • The simulation algorithm and the structure have not yet been interfaced.
  • An interface for the whole program that allows runtime changes

Web and Coding Club, STAB
and all others who contributed to this project

game of football

By Sumith Kulal

game of football

Final presentation of the Institute Technical Summer Project delivered to Web and Coding Club, IIT Bombay

  • 2,055