private void AddEntity(MySolarSystemMapData data, Vector3 posMillKm, float radiusMillKm, string name, MySolarSystemEntityEnum entityType, Color color, object entityData = null) { float radius = radiusMillKm * MyBgrCubeConsts.MILLION_KM; Vector3 offset; MyMwcVector3Int sector = MySolarSystemUtils.MillionKmToSectors(posMillKm, out offset); var entity = new MySolarSystemMapEntity(sector, offset, radius, name, entityType, color); entity.EntityData = entityData; data.Entities.Add(entity); }
public MySolarSystemMapEntity(MyMwcVector3Int sector, Vector3 positionInSector, float radius, string name, MySolarSystemEntityEnum entityType, Color color) { //System.Diagnostics.Debug.Assert(Math.Abs(positionInSector.X) <= MyBgrCubeConsts.SECTOR_SIZE / 2 && Math.Abs(positionInSector.Y) <= MyBgrCubeConsts.SECTOR_SIZE / 2 && Math.Abs(positionInSector.Z) <= MyBgrCubeConsts.SECTOR_SIZE / 2, "Position is out of sector!"); MinerWars.AppCode.Game.Utils.MyUtils.AssertIsValid(positionInSector); Sector = sector; PositionInSector = positionInSector; Radius = radius; Name = name; Color = color; EntityType = entityType; }
public MySolarSystemMapEntity(MyMwcVector3Int sector, Vector3 positionInSector, float radius, string name, MySolarSystemEntityEnum entityType) : this(sector, positionInSector, radius, name, entityType, Color.White) { }