//------------------------------------------------------------
// Tony Hyun Kim
// Spring 2007
// 18.354 Project: Lattice gas
// NODE HEADER
//------------------------------------------------------------

#ifndef NODE_H
#define NODE_H

#include "Common.h"

//------------------------------------------------------------
// TYPES
//------------------------------------------------------------
typedef struct occupation
{
	BYTE occ;  // Denotes occupation in directions
	BYTE type; // Denotes type of the occupant (0 or 1)
} OCCUPATION;

struct node;
typedef struct node
{
	node * neighbors[6];	// KEEP IN MIND THAT WE STORE THE 6TH NEIGHBOR
							// (OR DIRECTION) WITH INDEX 0
	OCCUPATION  current;
	OCCUPATION  next;
	D3DXVECTOR2	pos;

	// constructors/methods
	node();
	node(D3DXVECTOR2& p);
	node(float x, float y);
	void CalculateNext();
	void Update();
} NODE;

int CountNeighbors(const NODE* np);

#endif
