Beispiel #1
0
 public EntityModel(IMyEntity thisEntity, ulong tick)
 {
     _firstSeenTick         = tick;
     _thisCubeGrid          = (MyCubeGrid)thisEntity;
     _thisMyCubeGrid        = (IMyCubeGrid)thisEntity;
     ThisId                 = thisEntity.EntityId;
     base.Id                = ThisId.ToString();
     _thisCubeGrid.OnClose += Close;
     _thisCubeGrid.OnBlockOwnershipChanged += OwnershipChanged;
     _thisCubeGrid.OnBlockAdded            += BlockCountChanged;
     _thisCubeGrid.OnBlockRemoved          += BlockCountChanged;
     _thisCubeGrid.OnGridSplit             += GridSplit;
     _lastPassInformation = new GridInfo()
     {
         LinearVelocity = LinearVelocity, Position = Position, BlockCount = BlockCount
     };
     _lastPassInformation.ResetAll();
     if (string.IsNullOrEmpty(_thisCubeGrid.DisplayName))
     {
         return;
     }
     if (!EemStationFix.EemStations.Contains(_thisCubeGrid.DisplayName))
     {
         return;
     }
     if (_thisMyCubeGrid.Physics == null || _thisMyCubeGrid.IsStatic)
     {
         return;
     }
     _thisMyCubeGrid.Physics.LinearVelocity = Vector3.Zero;
     _thisCubeGrid.ConvertToStatic();
 }