//create new ship with a list of tiles public Ship newShip(string name, Sector sector, SectorPosition sectorPosition, Vector3 angle, List <Tile> tileList) { Ship ship = new Ship(name, this, sector, sectorPosition, angle, tileList); this.shipList.Add(ship); return(ship); }
public Ship(string name, Ships ships, Sector sector, SectorPosition sectorPosition, Vector3 angle, Tile tile) { this.name = name; this.ships = ships; this.sector = sector; this.sectorPosition = sectorPosition; this.angle = angle; this.tilesList.Add(tile); }
//acceleration or power/weight //turn rates //any other parts that aren't in cubes public Ship() { name = null; ships = null; sector = new Sector(); sectorPosition = new SectorPosition(); ObjectVelocity velocity = new ObjectVelocity(); List<Tile> tiles = new List<Tile>(); }
//acceleration or power/weight //turn rates //any other parts that aren't in cubes public Ship() { name = null; ships = null; sector = new Sector(); sectorPosition = new SectorPosition(); ObjectVelocity velocity = new ObjectVelocity(); List <Tile> tiles = new List <Tile>(); }
public Player(GameObject playerObject) { this.playerObject = playerObject; sector = new Sector(); sectorPosition = new SectorPosition(); Vector3 angle = new Vector3(0,0,0); ObjectVelocity velocity = new ObjectVelocity(); Vector3 angularVelocity = new Vector3(0,0,0); updateScriptRef(); }
public Player(GameObject playerObject) { this.playerObject = playerObject; sector = new Sector(); sectorPosition = new SectorPosition(); Vector3 angle = new Vector3(0, 0, 0); ObjectVelocity velocity = new ObjectVelocity(); Vector3 angularVelocity = new Vector3(0, 0, 0); updateScriptRef(); }
public Ship(string name, Ships ships, Sector sector, SectorPosition sectorPosition, Vector3 angle, List<Tile> tileList) { this.name = name; this.ships = ships; this.sector = sector; this.sectorPosition = sectorPosition; this.angle = angle; foreach (Tile tile in tileList) { this.tilesList.Add(tile); tile.ship = this; } }
public Map4D <TNode> SectorAt(int x, int y, int z, int w) { var sectorPosition = new SectorPosition(x / _sectorWidth, y / _sectorHeight, z / _sectorDepth, w / _sectorFourthDimension); if (!_sectors.TryGetValue(sectorPosition, out var sector)) { sector = new Map4D <TNode>(_sectorWidth, _sectorHeight, _sectorDepth, _sectorFourthDimension); _sectors[sectorPosition] = sector; _onSectorCreated?.Invoke(sector, sectorPosition.X * _sectorWidth, sectorPosition.Y * _sectorHeight, sectorPosition.Z * _sectorDepth, sectorPosition.W * _sectorFourthDimension); } return(sector); }
public Ship(string name, Ships ships, Sector sector, SectorPosition sectorPosition, Vector3 angle, List <Tile> tileList) { this.name = name; this.ships = ships; this.sector = sector; this.sectorPosition = sectorPosition; this.angle = angle; foreach (Tile tile in tileList) { this.tilesList.Add(tile); tile.ship = this; } }
public Map2D <TNode> SectorAt(int x, int y) { var sectorPosition = new SectorPosition(x / _sectorWidth, y / _sectorHeight); if (!_sectors.TryGetValue(sectorPosition, out var sector)) { sector = new Map2D <TNode>(_sectorWidth, _sectorHeight); _sectors[sectorPosition] = sector; _onSectorCreated?.Invoke(sector, sectorPosition.X * _sectorWidth, sectorPosition.Y * _sectorHeight); } return(sector); }
static public Vector3 GetScenePosition(Sector sector, SectorPosition position, Player player) { //get difference between player sector and ship int sectorOffsetX = sector.x - player.sector.x; int sectorOffsetY = sector.y - player.sector.y; int sectorOffsetZ = sector.z - player.sector.z; //get difference between player and ship sectorPosition float positionOffsetX = position.x - player.sectorPosition.x; float positionOffsetY = position.y - player.sectorPosition.y; float positionOffsetZ = position.z - player.sectorPosition.z; //get final distance between them by allowing for crossing of sector limit positionOffsetX = positionOffsetX + sectorOffsetX * HandlerScene.sectorSize; positionOffsetY = positionOffsetY + sectorOffsetY * HandlerScene.sectorSize; positionOffsetZ = positionOffsetZ + sectorOffsetZ * HandlerScene.sectorSize; return(new Vector3(positionOffsetX, positionOffsetY, positionOffsetZ)); }
public static Vector3 GetScenePosition(Sector sector, SectorPosition position, Player player) { //get difference between player sector and ship int sectorOffsetX = sector.x - player.sector.x; int sectorOffsetY = sector.y - player.sector.y; int sectorOffsetZ = sector.z - player.sector.z; //get difference between player and ship sectorPosition float positionOffsetX = position.x - player.sectorPosition.x; float positionOffsetY = position.y - player.sectorPosition.y; float positionOffsetZ = position.z - player.sectorPosition.z; //get final distance between them by allowing for crossing of sector limit positionOffsetX = positionOffsetX + sectorOffsetX * HandlerScene.sectorSize; positionOffsetY = positionOffsetY + sectorOffsetY * HandlerScene.sectorSize; positionOffsetZ = positionOffsetZ + sectorOffsetZ * HandlerScene.sectorSize; return new Vector3(positionOffsetX, positionOffsetY, positionOffsetZ); }
//create new ship with a list of tiles public Ship newShip(string name, Sector sector, SectorPosition sectorPosition, Vector3 angle, List<Tile> tileList) { Ship ship = new Ship(name, this, sector, sectorPosition, angle, tileList); this.shipList.Add(ship); return ship; }
public MarkSectorEventArgs(SectorPosition position) { Position = position; }
public Map4D <TNode> SafeSectorAt(int x, int y, int z, int w) { var sectorPosition = new SectorPosition(x / _sectorWidth, y / _sectorHeight, z / _sectorDepth, w / _sectorFourthDimension); return(!_sectors.TryGetValue(sectorPosition, out var sector) ? null : sector); }
public Map2D <TNode> SafeSectorAt(int x, int y) { var sectorPosition = new SectorPosition(x / _sectorWidth, y / _sectorHeight); return(!_sectors.TryGetValue(sectorPosition, out var sector) ? null : sector); }