예제 #1
0
        internal void SetFaction()
        {
            //StarIcons = new Dictionary<Guid, IDrawData>();
            int    i             = 0;
            double startangle    = 0;//Math.PI * 0.5;
            float  angleIncrease = (float)Math.Max(0.78539816339, 6.28318530718 / _state.StarSystemStates.Count);
            int    startR        = 200;
            int    radInc        = 5;

            foreach (var item in _state.StarSystemStates)
            {
                SystemMapRendering map = new SystemMapRendering(_window, _state);

                map.SetSystem(item.Value.StarSystem);
                RenderedMaps[item.Key] = map;

                //TODO: handle binary/multiple star systems better.
                var starEntity = item.Value.StarSystem.GetFirstEntityWithDataBlob <ECSLib.StarInfoDB>();
                var orbitdb    = starEntity.GetDataBlob <ECSLib.OrbitDB>();
                starEntity = orbitdb.Root; //just incase it's a binary system and the entity we got was not the primary

                var starIcon = new StarIcon(starEntity);
                StarIcons[item.Key] = starIcon;
                var nameIcon = new NameIcon(item.Value.EntityStatesWithNames[starEntity.Guid], _state);
                _nameIcons[item.Key] = nameIcon;
                var x = (startR + radInc * i) * Math.Sin(startangle - angleIncrease * i);
                var y = (startR + radInc * i) * Math.Cos(startangle - angleIncrease * i);
                starIcon.WorldPosition    = new ECSLib.Vector3(x, y, 0);
                nameIcon.WorldPosition    = new ECSLib.Vector3(x, y, 0);
                map.GalacticMapPosition.X = x;
                map.GalacticMapPosition.Y = y;
                i++;
            }
        }
예제 #2
0
        //public Shape[] DrawShapes;

        public SystemIcon(SystemState starSystemState)
        {
            _starIcon = new StarIcon(starSystemState.StarSystem.GetFirstEntityWithDataBlob <StarInfoDB>());
        }