blubber-server-0.0.1: The blubber server, serves blubber clients.

Copyright(c) plaimi 2015
LicenseAGPL-3
Maintainerblubber@plaimi.net
Safe HaskellNone
LanguageHaskell2010

Blubber.Server.Entity

Description

 

Synopsis

Documentation

data Entity Source

An Entity is a Blub with a position and mass.

Constructors

MkEntity 

Fields

position :: Vector

The position of the Blub.

mass :: Double

The mass of the Blub.

entity :: Blub

The Blub itself.

Instances

Eq Entity 
Ord Entity

Entitys may be ordered based on their mass.

Show Entity 
Generic Entity 
Serialize Entity

Entity uses a Serialize instance to encode its data.

type Rep Entity 

data Blub Source

The Blub is our hero. It is either a NeutralBlub that may simply be consumed by PlayerBlub, or it is indeed a PlayerBlub. A human-controlled Blub has a velocity and a target position in addition to the usual Entity stuff.

Constructors

NeutralBlub 
PlayerBlub 

Instances

Eq Blub 
Show Blub 
Generic Blub 
Serialize Blub

Blub uses a Serialize instance to encode its data.

type Rep Blub 

isNeutral :: Entity -> Bool Source

isNeutral is a quick hack to check if an Entity holds a NeutralBlub or not.

intersect :: Entity -> Entity -> Maybe Vector Source

Simple circle-circle-based intersect check of Entitys based on their radius.

fite :: (Entity, Entity) -> (Maybe Entity, Maybe Entity) Source

A fite between the passed in Entitys. The bigger one eats the smaller. If they are equal no one eats each other. They just hug.

blubber :: Entity -> Entity -> Entity Source

Let the first Entity blubber the second Entity. I.e. EAT IT! Omnomnom.