corporation

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID                 uint64
	Name               string
	Location           world.Coordinates
	ResourceProduction map[world.Resource]int
	StorageCapacity    float64
	StoredResources    map[world.Resource]int
}

type CorpGroup

type CorpGroup struct {
	Corporations map[uint64]*Corporation
	RW           sync.RWMutex
	Workers      int
	CorpChan     chan gamecomm.CorpCommand
}

func NewCorpGroup

func NewCorpGroup(gameChannels *gamecomm.GameChannels) *CorpGroup

func (*CorpGroup) AddCredits

func (c *CorpGroup) AddCredits(corporationId uint64, amount float64) (float64, error)

func (*CorpGroup) AddResources

func (c *CorpGroup) AddResources(corporationId uint64, resource world.Resource, amount int) (int, error)

func (*CorpGroup) FindCorporation

func (c *CorpGroup) FindCorporation(corporationId uint64) (Corporation, error)

func (*CorpGroup) RemoveCredits

func (c *CorpGroup) RemoveCredits(corporationId uint64, amount float64) (float64, error)

func (*CorpGroup) RemoveResources

func (c *CorpGroup) RemoveResources(corporationId uint64, resource world.Resource, amount int) (int, error)

func (*CorpGroup) Run

func (cg *CorpGroup) Run()

type Corporation

type Corporation struct {
	ID                              uint64
	Name                            string
	Reputation                      int
	Credits                         float64
	Bases                           []*Base
	CrewMembers                     []*CrewMember
	Squads                          []*Squad
	IsPlayer                        bool
	ReputationWithOtherCorporations map[string]int
	Rw                              sync.RWMutex
}

func (*Corporation) AddResourceToSquad

func (c *Corporation) AddResourceToSquad(squadIndex int, resource world.Resource, amount int) (int, error)

func (*Corporation) GetSquad

func (c *Corporation) GetSquad(squadIndex int) (Squad, error)

func (*Corporation) RemoveResourcesFromSquad

func (c *Corporation) RemoveResourcesFromSquad(squadIndex int, resource world.Resource, amount int) (int, error)

type CrewMember

type CrewMember struct {
	ID         uint64
	Name       string
	Species    string
	Skills     map[string]int
	AssignedTo uint64
}

type Squad

type Squad struct {
	Id          uint64
	Ships       *ship.Ship
	CrewMembers []*CrewMember
	Cargo       map[world.Resource]int
	Location    world.Coordinates
}

func (Squad) GetHarvestingBonus

func (s Squad) GetHarvestingBonus() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL