Example #1
0
        private MyIDModule TryGetEntityIdModule()
        {
            MyIDModule module;
            IMyComponentOwner <MyIDModule> entity = base.Entity as IMyComponentOwner <MyIDModule>;

            if ((entity == null) || !entity.GetComponent(out module))
            {
                return(null);
            }
            return(module);
        }
Example #2
0
        public static bool CanBeUsedByPlayer(long playerId, IMyEntity Entity)
        {
            MyIDModule module;
            IMyComponentOwner <MyIDModule> owner = Entity as IMyComponentOwner <MyIDModule>;

            if ((owner == null) || !owner.GetComponent(out module))
            {
                return(true);
            }
            MyRelationsBetweenPlayerAndBlock userRelationToOwner = module.GetUserRelationToOwner(playerId);

            return((userRelationToOwner != MyRelationsBetweenPlayerAndBlock.NoOwnership) && ((userRelationToOwner - 3) > MyRelationsBetweenPlayerAndBlock.Owner));
        }