Skip to content

Instantly share code, notes, and snippets.

@rozgo
Created February 25, 2014 07:02
Show Gist options
  • Save rozgo/9204131 to your computer and use it in GitHub Desktop.
Save rozgo/9204131 to your computer and use it in GitHub Desktop.
module Bowel.Bow
module Player =
type UserId = UserId of string
type UserName = UserName of string
type Player =
{
UserId : UserId
UserName : UserName
}
module Geo =
type Latitude = Latitude of int
type Longitude = Longitude of int
type Coord =
{
Latitude : Latitude
Longitude : Longitude
}
module Currency =
type Amount = Amount of int
module Resource =
type OilCurrency = OilCurrency of Currency.Amount
type SilverCurrency = SilverCurrency of Currency.Amount
type GoldCurrency = GoldCurrency of Currency.Amount
type Oil = OilCurrency
type Silver = SilverCurrency
type Gold = GoldCurrency
type Resource = Oil | Silver | Gold
module Tile =
type ResourceTile =
{
Oil : Resource.Oil
Silver : Resource.Silver
Gold : Resource.Gold
}
type Type = LandTile | ResourceTile | OutpostTile | BaseTile
type Occupant = UserId | Abandoned
type Id = Id of string
type Tile = {
Tile : Id
Location : Geo.Coord
Type : Type
Occupant : Occupant
}
module Vehicle =
type Aircraft = Helicopter | Blimp
type Tracked = Tank
type Vehicle = Watercraft | Aircraft | Wheeled | Railed | Tracked
module Unit =
type Unit = Rifleman | Sniper | Medic | Flamethrower
module Mobilization =
type Rally = Vehicle.Tracked * Unit list
type Airstrike = Vehicle.Aircraft list
type MobilizationType = Rally | Reinforcement | ResourceHelp | Scout | Outpost | ResourceGather | Airstrike
type Mobilization = {
Type : MobilizationType
From : Tile.Id
To : Tile.Id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment