示例#1
0
        public void FoundPlayer(long playerIdentityId, MyObjectBuilder_Character character)
        {
            var charPosition   = character?.PositionAndOrientation?.Position;
            var playerPosition = new Vector3D(charPosition.Value.x, charPosition.Value.y, charPosition.Value.z);

            FoundPlayers[playerIdentityId] = new ZoneScanResultItem()
            {
                PlayerIdentityId = playerIdentityId,
                Character        = character,
                DistanceToCenter = Vector3D.Distance(ZoneCenter, playerPosition)
            };

            CharactersFound = FoundPlayers.Count;
        }
示例#2
0
        public void FoundPilotedShip(long playerIdentityId, MyCubeGrid ship)
        {
            var shipPosition = ship.PositionComp.GetPosition();

            var shipBlocks  = ship.GetBlocks();
            var totalBlocks = shipBlocks.Count();


            FoundShips[playerIdentityId] = new ZoneScanResultItem()
            {
                PlayerIdentityId = playerIdentityId,
                Ship             = ship,
                DistanceToCenter = Vector3D.Distance(ZoneCenter, shipPosition) //,
                                                                               //IsLargeShip = (largeBlocks > smallBlocks),
                                                                               //ShipBlockCount = largeBlocks + smallBlocks //TODO: This should be probably based on large block count
            };

            ShipsFound = FoundShips.Count;
        }