Esempio n. 1
0
 private void Awake()
 {
     stateful        = GetComponent <Stateful>();
     objectBehaviour = GetComponent <ObjectBehaviour>();
     integrity       = GetComponent <Integrity>();
     spriteHandler   = GetComponentInChildren <SpriteHandler>();
 }
        private void SetColumnOptions()
        {
            this.valueSelectColumns.Clear();

            DataItemModel fromTable = this.uxTableName.SelectedItem.To <DataItemModel>();

            if (fromTable == null)
            {
                return;
            }

            this.valueSelectColumns.Add(new DataItemModel {
                DisplayValue = Constants.None, ItemKey = Constants.None
            });

            foreach (DataItemModel tableColumn in Integrity.GetColumnsForTable(fromTable.DisplayValue).OrderBy(t => t.DisplayValue))
            {
                DataItemModel optionColumn = new DataItemModel
                {
                    DisplayValue = $"{fromTable.DisplayValue}.{tableColumn.DisplayValue}",
                    ItemKey      = $"{fromTable.DisplayValue}.{tableColumn.DisplayValue}"
                };

                this.valueSelectColumns.Add(optionColumn);
            }
        }
        private void ShowAddColumn()
        {
            try
            {
                ColumnObjectModel column = new ColumnObjectModel {
                    Column_Id = int.MaxValue
                };

                ColumnsEdit columnEdit = new ColumnsEdit(column, this.Table.TableName);

                bool?result = columnEdit.ShowDialog();

                if (result == null || !result.Value)
                {
                    return;
                }

                column.HasModelChanged = false; // This is to clear the model changes values. Especialy for new column creation

                this.Table.Columns = this.Table.Columns.Add(columnEdit.Column);

                Integrity.MapColumn(column, this.Table.TableName);

                if (column.IsForeignkey)
                {
                    this.ForeignKeyColumnAdded?.Invoke(this, column);
                }

                this.TableColumnChanged?.Invoke(this, column);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.GetFullExceptionMessage());
            }
        }
Esempio n. 4
0
 private void Awake()
 {
     integrity = GetComponent <Integrity>();
     integrity.OnBurnUpServer += OnBurnUpServer;
     meatSteakPrefab           = Resources.Load <GameObject>("Meat Steak");
     registerTile              = GetComponent <RegisterTile>();
 }
        /// <summary>
        /// Turns this body part into ash while protecting items inside of that cannot be ashed.
        /// </summary>
        private void AshBodyPart()
        {
            if (currentBurnDamageLevel >= TraumaDamageLevel.CRITICAL)
            {
                if (this.BodyPartType == BodyPartType.Chest || this.BodyPartType == BodyPartType.Head)
                {
                    return;                                                                                                    //TODO is temporary weighting on Trauma discussion
                }
                IEnumerable <ItemSlot> internalItemList = OrganStorage.GetItemSlots();
                foreach (ItemSlot item in internalItemList)
                {
                    Integrity itemObject = item.ItemObject.OrNull()?.GetComponent <Integrity>();
                    if (itemObject != null)                    //Incase this is an empty slot
                    {
                        if (itemObject.Resistances.FireProof || itemObject.Resistances.Indestructable)
                        {
                            Inventory.ServerDrop(item);
                        }
                    }
                }

                _ = Spawn.ServerPrefab(OrganStorage.AshPrefab, HealthMaster.RegisterTile.WorldPosition);
                HealthMaster.DismemberBodyPart(this);
                _ = Despawn.ServerSingle(gameObject);
            }
        }
Esempio n. 6
0
        private void RemoveGenerator(GameObject generatorToRemove, Integrity generatorIntegrity = null, bool removeConnected = true)
        {
            foreach (var generator in connectedGenerator.ToArray())
            {
                if (generator.Value.Item1 != generatorToRemove.gameObject)
                {
                    continue;
                }

                InternalRemoveGenerator(generatorToRemove, generator.Key);

                if (generatorIntegrity == null)
                {
                    generatorIntegrity = generatorToRemove.GetComponent <Integrity>();
                }

                connectedGenerator.Remove(generator.Key);
                generatorIntegrity.OnWillDestroyServer.RemoveListener(OnConnectedDestroy);

                if (removeConnected)
                {
                    //Tell connected generator to remove us
                    generatorToRemove.GetComponent <FieldGenerator>().RemoveGenerator(gameObject, removeConnected: false);
                }
                break;
            }
        }
        private void AddSelectFromColumnOption(string selectedValue, int desiredIndex)
        {
            DataItemModel fromTable = this.uxFromTable.SelectedItem.To <DataItemModel>();

            bool haveChild = desiredIndex < this.uxSelectColumnsStack.Children.Count;

            ComboBoxTool resultBox = haveChild ?
                                     this.uxSelectColumnsStack.Children[desiredIndex].To <ComboBoxTool>()
                                :
                                     new ComboBoxTool();

            if (!haveChild)
            {
                resultBox.Items.Add(new DataItemModel {
                    DisplayValue = Constants.None, ItemKey = Constants.None
                });

                foreach (DataItemModel tableColumn in Integrity.GetColumnsForTable(fromTable.DisplayValue).OrderBy(t => t.DisplayValue))
                {
                    DataItemModel optionColumn = new DataItemModel
                    {
                        DisplayValue = $"{fromTable.DisplayValue}.{tableColumn.DisplayValue}",
                        ItemKey      = $"{fromTable.DisplayValue}.{tableColumn.DisplayValue}"
                    };

                    resultBox.Items.Add(optionColumn);
                }
                resultBox.SelectionChanged += this.SelectColumnChanged;

                this.uxSelectColumnsStack.Children.Add(resultBox);
            }

            resultBox.SelectedValue = selectedValue;
        }
Esempio n. 8
0
        private void DataBaseTypeLink()
        {
            this.uxRelationName.Content = Integrity.BuildForeighKeyName(this.SelectedParentTable.ItemKey.ToString(), this.SelectedChildTable.ItemKey.ToString());

            foreach (ColumnObjectModel keyColumn in Integrity.GetObjectModel(this.SelectedParentTable.ItemKey.ToString()).Where(pk => pk.InPrimaryKey))
            {
                ComboBoxTool parentBox = new ComboBoxTool();

                ComboBoxTool childBox = new ComboBoxTool();

                parentBox.Name = $"{parentComboName}{this.uxParentColumns.Children.Count}";

                childBox.Name = $"{childComboName}{this.uxChildColumns.Children.Count}";

                parentBox.Items.Add(new DataItemModel {
                    DisplayValue = keyColumn.ColumnName, ItemKey = keyColumn.ColumnName
                });

                foreach (DataItemModel item in Integrity.GetColumnsForTable(this.SelectedChildTable.ItemKey.ToString()))
                {
                    childBox.Items.Add(item);
                }

                parentBox.SelectedValue = keyColumn.ColumnName;

                this.uxParentColumns.Children.Add(parentBox);

                this.uxChildColumns.Children.Add(childBox);
            }
        }
Esempio n. 9
0
 private void Awake()
 {
     gunSlot         = GetComponent <ItemStorage>().GetIndexedItemSlot(0);
     stateful        = GetComponent <Stateful>();
     objectBehaviour = GetComponent <ObjectBehaviour>();
     integrity       = GetComponent <Integrity>();
 }
Esempio n. 10
0
 public DamageInfo(float damage, AttackType attackType, DamageType damageType, Integrity attackedIntegrity)
 {
     DamageType        = damageType;
     Damage            = damage;
     AttackType        = attackType;
     AttackedIntegrity = attackedIntegrity;
 }
        public static string DropForeignKey(string integrityDropString)
        {
            IScripting scriptor = Scripting.CreateClass();

            string[] keySplit = integrityDropString.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

            return(scripting.DropForeignKey(Integrity.GetTableSchema(keySplit[0]), keySplit[0], keySplit[1]));
        }
Esempio n. 12
0
 private void Awake()
 {
     registerTile    = GetComponent <RegisterTile>();
     integrity       = GetComponent <Integrity>();
     wrenchSecurable = GetComponent <WrenchSecurable>();
     spriteHandler   = GetComponentInChildren <SpriteHandler>();
     directional     = GetComponent <Directional>();
 }
Esempio n. 13
0
 private void Awake()
 {
     spriteHandler    = GetComponentInChildren <SpriteHandler>();
     objectBehaviour  = GetComponent <ObjectBehaviour>();
     registerTile     = GetComponent <RegisterTile>();
     objectAttributes = GetComponent <ObjectAttributes>();
     integrity        = GetComponent <Integrity>();
 }
Esempio n. 14
0
		public ItemCopyer(IPersister persister, Navigator navigator, Integrity.IIntegrityManager integrity, IVersionManager versions, ContentVersionRepository versionRepository)
		{
            this.persister = persister;
			this.navigator = navigator;
			this.integrity = integrity;
			this.versions = versions;
			this.versionRepository = versionRepository;
		}
 public void IntegrityIdentityFileWrongSignature()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] idFile = dataTest.GetIdFile();
     byte[] idSignatureFile = dataTest.GetAddressSignatureFile();
     byte[] certificateRRN = dataTest.GetCertificateRNFile();
     Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
 }
Esempio n. 16
0
 private void Awake()
 {
     spriteRenderer       = GetComponentInChildren <SpriteRenderer>();
     APCConnectionHandler = GetComponent <APCPoweredDevice>();
     power        = GetComponent <APCPoweredDevice>();
     registerTile = GetComponent <RegisterTile>();
     integrity    = GetComponent <Integrity>();
     integrity.OnApplyDamage.AddListener(OnDamageReceived);
 }
Esempio n. 17
0
 private void Awake()
 {
     if (currentState != TeslaCoilState.Grounding)
     {
         moduleSupplyingDevice = GetComponent <ModuleSupplyingDevice>();
     }
     wrenchSecurable = GetComponent <WrenchSecurable>();
     integrity       = GetComponent <Integrity>();
 }
Esempio n. 18
0
 private void Awake()
 {
     registerTile       = GetComponent <RegisterTile>();
     itemStorage        = GetComponent <ItemStorage>();
     apcPoweredDevice   = GetComponent <APCPoweredDevice>();
     integrity          = GetComponent <Integrity>();
     accessRestrictions = GetComponent <AccessRestrictions>();
     lineRenderer       = GetComponentInChildren <LineRenderer>();
 }
Esempio n. 19
0
    private void EnsureInit()
    {
        if (isInit)
        {
            return;
        }
        if (mLightRendererObject == null)
        {
            mLightRendererObject = LightSpriteBuilder.BuildDefault(gameObject, new Color(0, 0, 0, 0), 12);
        }

        if (spriteRenderer == null)
        {
            spriteRenderer = GetComponentInChildren <SpriteRenderer>();
        }

        if (spriteRendererLightOn == null)
        {
            spriteRendererLightOn = GetComponentsInChildren <SpriteRenderer>().Length > 1
                        ? GetComponentsInChildren <SpriteRenderer>()[1] : GetComponentsInChildren <SpriteRenderer>()[0];
        }

        if (lightSprite == null)
        {
            lightSprite = mLightRendererObject.GetComponent <LightSprite>();
        }

        if (emergencyLightAnimator == null)
        {
            emergencyLightAnimator = GetComponent <EmergencyLightAnimator>();
        }

        if (integrity == null)
        {
            integrity = GetComponent <Integrity>();
        }

        if (directional == null)
        {
            directional = GetComponent <Directional>();
        }

        if (currentState == null)
        {
            ChangeCurrentState(InitialState);
        }

        if (traitRequired == null)
        {
            traitRequired = currentState.TraitRequired;
        }

        if (!isWithoutSwitch)
        {
            switchState = InitialState == LightMountState.On;
        }
    }
 public void IntegrityFails()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] idFile = dataTest.GetIdFile();
     byte[] idSignatureFile = dataTest.GetIdSignatureFile();
     byte[] certificateRRN = null;
     Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
 }
Esempio n. 21
0
 void Awake()
 {
     cnt         = GetComponent <CustomNetTransform>();
     registerObj = GetComponent <RegisterObject>();
     dirSprites  = GetComponent <NPCDirectionalSprites>();
     health      = GetComponent <LivingHealthBehaviour>();
     integrity   = GetComponent <Integrity>();
     agentParameters.onDemandDecision = true;
 }
Esempio n. 22
0
 private void Awake()
 {
     BlewUp                 = false;
     objectBehaviour        = GetComponent <ObjectBehaviour>();
     registerObject         = GetComponent <RegisterObject>();
     integrity              = GetComponent <Integrity>();
     reagentContainerScript = GetComponent <ReagentContainer>();
     reagentContainerObjectInteractionScript = GetComponent <ReagentContainerObjectInteractionScript>();
     integrity.OnWillDestroyServer.AddListener(WhenDestroyed);
 }
 public void ValidityAuthenticationChain()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     List<byte[]> caCerts = new List<byte[]>();
     caCerts.Add(dataTest.GetCertificateCAFile());
     Assert.True(integrityTest.CheckCertificateChain(
         caCerts,
         dataTest.GetCertificateAuthenticationFile()));
 }
Esempio n. 24
0
        public void IntegrityIdentityFile()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] idFile          = dataTest.GetIdFile();
            byte[] idSignatureFile = dataTest.GetIdSignatureFile();
            byte[] certificateRRN  = dataTest.GetCertificateRNFile();
            Assert.IsTrue(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
        }
Esempio n. 25
0
        public void IntegrityIdentityFileWrongCertificate()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] idFile          = dataTest.GetIdFile();
            byte[] idSignatureFile = dataTest.GetIdSignatureFile();
            byte[] certificateRoot = dataTest.GetCertificateRootFile();
            Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRoot));
        }
Esempio n. 26
0
        public void IntegrityFails()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] idFile          = dataTest.GetIdFile();
            byte[] idSignatureFile = dataTest.GetIdSignatureFile();
            byte[] certificateRRN  = null;
            Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
        }
Esempio n. 27
0
        private void Awake()
        {
            if (!CustomNetworkManager.IsServer)
            {
                return;
            }

            integrity = GetComponent <Integrity>();

            integrity.OnWillDestroyServer.AddListener(WhenDestroyed);
        }
        public void ValidityAuthenticationChain()
        {
            ReadData      dataTest      = new ReadData("beidpkcs11D.dll");
            Integrity     integrityTest = new Integrity();
            List <byte[]> caCerts       = new List <byte[]>();

            caCerts.Add(dataTest.GetCertificateCAFile());
            Assert.True(integrityTest.CheckCertificateChain(
                            caCerts,
                            dataTest.GetCertificateAuthenticationFile()));
        }
Esempio n. 29
0
 private void Awake()
 {
     cnt             = GetComponent <CustomNetTransform>();
     registerObj     = GetComponent <RegisterObject>();
     objectBehaviour = GetComponent <ObjectBehaviour>();
     directional     = GetComponent <Directional>();
     health          = GetComponent <LivingHealthBehaviour>();
     integrity       = GetComponent <Integrity>();
     OriginTile      = GetComponent <RegisterTile>();
     agentParameters.onDemandDecision = true;
 }
Esempio n. 30
0
        public static void SetActive(object gameObject, bool active)
        {
            Integrity.EnsureNotNull(gameObject);
            Integrity.EnsureGameObject(gameObject);

            var setActive = GameObjectType.GetMethod(
                Resources.UnityEngine.GameObjectSetActiveMethodName,
                BindingFlags.Public | BindingFlags.Instance
                );

            setActive.Invoke(gameObject, new object[] { active });
        }
Esempio n. 31
0
        private void Awake()
        {
            HackingProcessBase = GetComponent <HackingProcessBase>();
            if (CustomNetworkManager.IsServer == false)
            {
                return;
            }

            integrity = GetComponent <Integrity>();

            integrity.OnWillDestroyServer.AddListener(WhenDestroyed);
        }
Esempio n. 32
0
        private void Awake()
        {
            spriteRenderer       = GetComponentInChildren <SpriteRenderer>();
            APCConnectionHandler = GetComponent <APCPoweredDevice>();
            power        = GetComponent <APCPoweredDevice>();
            registerTile = GetComponent <RegisterTile>();
            integrity    = GetComponent <Integrity>();
            integrity.OnApplyDamage.AddListener(OnDamageReceived);

            audioSourceParameters = new AudioSourceParameters(Volume, 0, 0, 0, 1, Spread,
                                                              MinSoundDistance, MaxSoundDistance, MixerType.Muffled, VolumeRolloffType.EaseInAndOut, false);
        }
Esempio n. 33
0
        private void Awake()
        {
            APCConnectionHandler = GetComponent <APCPoweredDevice>();
            power        = GetComponent <APCPoweredDevice>();
            registerTile = GetComponent <RegisterTile>();
            integrity    = GetComponent <Integrity>();
            integrity.OnApplyDamage.AddListener(OnDamageReceived);

            audioSourceParameters = new AudioSourceParameters(volume: Volume, spatialBlend: 1, spread: Spread,
                                                              minDistance: MinSoundDistance, maxDistance: MaxSoundDistance, mixerType: MixerType.Muffled,
                                                              volumeRolloffType: VolumeRolloffType.EaseInAndOut);
        }
Esempio n. 34
0
        public static void DetachSceneLoadedEventHandler()
        {
            Integrity.EnsureNotNull(PreviousSceneLoadedAttachTarget);
            Integrity.EnsureNotNull(SceneLoadedEventHandlerDelegate);

            var ev = SceneManagerType.GetEvent(
                Resources.UnityEngine.SceneLoadedEventName,
                BindingFlags.Public | BindingFlags.Static
                );

            ev.RemoveEventHandler(PreviousSceneLoadedAttachTarget, SceneLoadedEventHandlerDelegate);
        }
 public void IntegrityAddressFile()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] addressFile = trimRight(dataTest.GetAddressFile());
     byte[] idSignatureFile = dataTest.GetIdSignatureFile();
     byte[] concatFiles = new byte[addressFile.Length + idSignatureFile.Length];
     Array.Copy(addressFile, 0, concatFiles, 0, addressFile.Length);
     Array.Copy(idSignatureFile, 0, concatFiles, addressFile.Length, idSignatureFile.Length);
     byte[] addressSignatureFile = dataTest.GetAddressSignatureFile();
     byte[] certificateRRN = dataTest.GetCertificateRNFile();
     Assert.True(integrityTest.Verify(concatFiles, addressSignatureFile, certificateRRN));
 }
Esempio n. 36
0
 public void SignSignature()
 {
     // Sign
     Sign signTest = new Sign("beidpkcs11.dll");
     byte[] testdata = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
     byte[] signeddata = signTest.DoSign(testdata, "Signature");
     Assert.IsNotNull(signeddata);
     // Verification
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     Assert.False(integrityTest.Verify(testdata, signeddata,
         dataTest.GetCertificateAuthenticationFile()));
     Assert.True(integrityTest.Verify(testdata, signeddata,
         dataTest.GetCertificateSignatureFile()));
 }
Esempio n. 37
0
        protected void SetErrorMessage(BaseValidator validator, Integrity.NameOccupiedException ex)
        {
            Trace.Write(ex.ToString());

            string message = string.Format("An item named '{0}' already exists below '{1}'",
                ex.SourceItem.Name,
                ex.DestinationItem.Name);
            SetErrorMessage(validator, message);
        }
Esempio n. 38
0
        protected void SetErrorMessage(BaseValidator validator, Integrity.DestinationOnOrBelowItselfException ex)
        {
            Trace.Write(ex.ToString());

            string message = string.Format("Cannot move an item to a destination onto or below itself",
                ex.SourceItem.Name,
                ex.DestinationItem.Name);
            SetErrorMessage(validator, message);
        }