示例#1
0
        public void ClientSetReactorMode(
            IStaticWorldObject worldObjectGenerator,
            byte reactorIndex,
            bool isEnabled)
        {
            var reactorPrivateState = SharedGetReactorPrivateState(worldObjectGenerator, reactorIndex);

            if (reactorPrivateState.IsEnabled == isEnabled)
            {
                // no change necessary
                return;
            }

            if (isEnabled &&
                !SharedCanActivateReactor(worldObjectGenerator, reactorPrivateState, logErrors: true))
            {
                return;
            }

            ProtoEntityRemoteExtensions.CallServer(this,
                                                   _ => _.ServerRemote_SetReactorMode(
                                                       worldObjectGenerator,
                                                       reactorIndex,
                                                       isEnabled));
        }
示例#2
0
        public void ClientBuildReactor(IStaticWorldObject worldObjectGenerator, byte reactorIndex)
        {
            if (!InputItemsHelper.SharedPlayerHasRequiredItems(ClientCurrentCharacterHelper.Character,
                                                               this.BuildAdditionalReactorRequiredItems,
                                                               noCheckInCreativeMode: true))
            {
                NotificationSystem.ClientShowNotification(
                    ObjectTinkerTable.ErrorMessage_ComponentItemsRequried,
                    color: NotificationColor.Bad,
                    icon: this.Icon);
                return;
            }

            ProtoEntityRemoteExtensions.CallServer(this,
                                                   _ => _.ServerRemote_BuildReactor(
                                                       worldObjectGenerator,
                                                       reactorIndex));
        }