Giter VIP home page Giter VIP logo

foot's Introduction

Foot

2D Turn-Based Football Management Simulator (C#/.Net) for Godot

This code sample gives a snapshot of the implementation of the game's league and cup fixture systems.

  • The abstract superclass Competition is extended by the abstract subclasses Cup & Division.

  • These can be extended by various different instances configured for different types of Cup competitions (Division Cup, Seeded Cup & Unseeded Cup), with different numbers of teams, rounds and methods for drawing each round.

  • And similarly, different Division subclasses can have different configurations for promotion, relegation and playoffs.

  • When a Division object is created, it takes a List of Ints as a parameter - representing the clubs - and constructs the fixture list using Berger Tables (a round-robin system). The Division instance contains a Queue of Lists, where each List represents a game week. Each List is populated by Fixture objects - representing the week's Fixtures - each of which contain two ints, representing the Home and Away sides.

  • Each team plays every other team twice - home and away (taking (n-1) * 2 weeks, where n is the size of the division). The Home and Away matches are in two different halves of the season, and no team plays consecutive Home or Away matches. Furthermore, the two halves of the season are not mirrored, and are instead randomised, though any given game week occurs twice in a Season (with the Home/Away teams reversed).

  • Finally, the player's team (0) is always positioned in any given week's Fixture List (Cup or Division) at index 0.

  • The Competition superclass implements the construction of the initial Berger tables and the randomising of lists of teams, since these can also be utilised in the implementation of Cup Competitions - in forming the basis of group stages, and the drawing of rounds respectively.

  • The Cup Subclass contains implementations for drawing a single round, and a function to recursively draw every round, pushing the final onto the bottom of the stack first, and working backwards.

foot's People

Contributors

johnoleary87 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.