deployables.go 682 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package main
  2. type FighterMode uint8
  3. const (
  4. Attack FighterMode = iota
  5. Toll
  6. Pass
  7. )
  8. type DeployedFighter struct {
  9. ID ID
  10. Amount uint64
  11. Mode FighterMode
  12. Owner ID
  13. CorpOwned bool
  14. }
  15. func (f *DeployedFighter) TollCost() uint64 {
  16. if f.Mode != Toll {
  17. return 0
  18. }
  19. return f.Amount * 3
  20. }
  21. func (f *DeployedFighter) Damage() int64 {
  22. if f.Mode == Pass {
  23. return 0
  24. }
  25. return int64(f.Amount) * 6
  26. }
  27. type DeployedMine struct {
  28. ID ID
  29. Amount uint64
  30. Owner ID
  31. CorpOwned bool
  32. }
  33. func (m *DeployedMine) Damage() int64 {
  34. return int64(m.Amount) * 15
  35. }
  36. type DeployedTrackerMine struct {
  37. ID ID
  38. Amount uint64
  39. Owner ID
  40. CorpOwned bool
  41. }