Content.Server/GameObjects/Components/ComputerComponent.cs
/// <summary>
///     Creates the corresponding computer board on the computer.
///     This exists so when you deconstruct computers that were serialized with the map,
///     you can retrieve the computer board.
/// </summary>
Creates the corresponding computer board on the computer.
This exists so when you deconstruct computers that were serialized with the map,
you can retrieve the computer board.
Creates the corresponding computer board on the computer . This exists so when you deconstruct computers that were serialized with the map you can retrieve the computer board .
private void CreateComputerBoard()
        {
            if (string.IsNullOrEmpty(_boardPrototype))
                return;
            var container = ContainerManagerComponent.Ensure<Container>("board", Owner, out var existed);
            if (existed)
            {
                if (container.ContainedEntities.Count != 0)
                    return;
            }
            var board = Owner.EntityManager.SpawnEntity(_boardPrototype, Owner.Transform.Coordinates);
            if(!container.Insert(board))
                Logger.Warning($"Couldn't insert board {board} to computer {Owner}!");
            if (Owner.TryGetComponent(out ConstructionComponent construction))
                construction.AddContainer("board");
        }
private void CreateComputerBoard ( ) { if ( string . IsNullOrEmpty ( _boardPrototype ) ) return ; var container = ContainerManagerComponent . Ensure < Container > ( " " , Owner , out var existed ) ; if ( existed ) { if ( container . ContainedEntities . Count != 0 ) return ; } var board = Owner . EntityManager . SpawnEntity ( _boardPrototype , Owner . Transform . Coordinates ) ; if ( ! container . Insert ( board ) ) Logger . Warning ( $" Couldn't insert board  { board }  to computer  { Owner } ! " ) ; if ( Owner . TryGetComponent ( out ConstructionComponent construction ) ) construction . AddContainer ( " " ) ; }
Creates the corresponding computer board on the computer.
Creates the corresponding computer board on the computer .
// We don't do anything if this is null or empty. // We already contain a board. Note: We don't check if it's the right one!