public TileCoord(GameEntity entity, Point coord, Point size, TileSystemComponent tileSystem) : base(entity) { tileSystem_ = tileSystem; coord_ = coord; size_ = size; }
public TileCoord(GameEntity entity, Point coord, Point size, TileSystemComponent tileSystem) : base(entity) { tileSystem_ = tileSystem; coord_ = coord; size_ = size; }
public TileArea(TileSystemComponent parent, Point size, Point offset) { parent_ = parent; size_ = size; offset_ = offset; tiles_ = new TileStatus[size_.X, size_.Y]; }
public TileArea(TileSystemComponent parent, Point size, Point offset) { parent_ = parent; size_ = size; offset_ = offset; tiles_ = new TileStatus[size_.X, size_.Y]; }
public override Component deepCopy(GameEntity entity) { TileSystemComponent c = new TileSystemComponent(entity); foreach (TileArea area in areas_) { c.areas_.Add(area.deepCopy(c)); } return(c); }
public GameEntity pick(TileSystemComponent tsc, Point point) { foreach (TileCoord tile in tiles_) { if (tile.tileSystem_ == tsc) { if (tile.isWithin(point)) { return tile.entity_; } } } return null; }
private Ship(GameEntity world) { entity_ = new GameEntity(); entity_.spatial = new Components.SpatialComponent(entity_, world.spatial); entity_.physic = new PhysicsComponent(entity_, Vector2.Zero, 0, Vector2.Zero); Locator.getComponentManager().addEntity(entity_); tiles = new Components.TileSystemComponent(entity_); tiles.addArea(new Point(16, 8), Point.Zero); tiles.addArea(new Point(16, 8), new Point(0, 10)); tiles.addArea(new Point(16, 8), new Point(0, 20)); tiles.addArea(new Point(6, 28), new Point(16, 0)); tiles.addArea(new Point(10, 16), new Point(22, 6)); tiles.addArea(new Point(10, 8), new Point(32, 10)); tiles.addArea(new Point(6, 16), new Point(42, 6)); tiles.generateTileEntities(entity_); }
private Ship(GameEntity world) { entity_ = new GameEntity(); entity_.spatial = new Components.SpatialComponent(entity_, world.spatial); entity_.physic = new PhysicsComponent(entity_, Vector2.Zero, 0, Vector2.Zero); Locator.getComponentManager().addEntity(entity_); tiles = new Components.TileSystemComponent(entity_); tiles.addArea(new Point(16, 8), Point.Zero); tiles.addArea(new Point(16, 8), new Point(0, 10)); tiles.addArea(new Point(16, 8), new Point(0, 20)); tiles.addArea(new Point(6, 28), new Point(16, 0)); tiles.addArea(new Point(10, 16), new Point(22, 6)); tiles.addArea(new Point(10, 8), new Point(32, 10)); tiles.addArea(new Point(6, 16), new Point(42, 6)); tiles.generateTileEntities(entity_); }
public TileArea deepCopy(TileSystemComponent parent) { return(new TileArea(parent, size_, offset_)); }
public TileArea deepCopy(TileSystemComponent parent) { return new TileArea(parent, size_, offset_); }