Пример #1
0
        public void FindTargetOnExplore(string name, string version)
        {
            SdkSchema    sdkSchema    = new SdkSchema();
            TargetSchema targetSchema = new TargetSchema();

            targetSchema.name    = name;
            targetSchema.version = version;
            sdkSchema.Target     = new[] { targetSchema };

            sdkExplorer.ExploreSdk(null, false)
            .ReturnsForAnyArgs(Task.FromResult(sdkSchema));
        }
Пример #2
0
        public new void Start()
        {
            base.Start();
            Timer = GetComponent <Timer>();

            BelongsToAlly = GetComponentsInParent <AllyCombatant>().Length == 1;

            TargetSchema = new TargetSchema(
                1,
                BelongsToAlly ? CombatantType.Enemy : CombatantType.Ally,
                SelectorType.Number);
        }
Пример #3
0
        public new void Start()
        {
            base.Start();
            Timer    = GetComponent <Timer>();
            Animator = GetComponentInParent <Animator>();


            TargetSchema = new TargetSchema(
                1,
                CombatantType.Ally,
                SelectorType.Number);
        }
Пример #4
0
        protected IEnumerable <string> ObsoleteCollectionNames(IMongoDatabase database, MongoStorageOptions storageOptions)
        {
            var mongoSchemas = Enum.GetValues(typeof(MongoSchema)).Cast <MongoSchema>().OrderBy(v => v).ToList();
            var index        = mongoSchemas.IndexOf(TargetSchema);

            if (index <= 0)
            {
                return(Enumerable.Empty <string>());
            }
            var previousCollectionNames = mongoSchemas[index - 1].CollectionNames(storageOptions.Prefix);
            var collectionNames         = TargetSchema.CollectionNames(storageOptions.Prefix);

            return(previousCollectionNames.Where(name => !collectionNames.Contains(name)));
        }
Пример #5
0
    public new void Start()
    {
        base.Start();
        Thunder           = GameObject.Find("Thunderstorm");
        Timer             = GetComponent <Timer>();
        ParticleComponent = Thunder.GetComponent <ParticleSystem>();
        MainModule        = ParticleComponent.main;
        Thunder.SetActive(false);

        TargetSchema = new TargetSchema(
            0,
            CombatantType.Enemy,
            SelectorType.All);
    }
Пример #6
0
    public new void Start()
    {
        Ganiel = GameObject.Find("Ganiel");
        ConfectionMixObject = GameObject.Find("ConfectionPowerMove");
        ConfectionMixVfx    = ConfectionMixObject.GetComponent <ConfectionVfx>();
        base.Start();
        Timer = GetComponent <Timer>();

        StartUI();

        TargetSchema = new TargetSchema(
            1,
            CombatantType.Enemy,
            SelectorType.Number);
    }
Пример #7
0
        public new void Start()
        {
            base.Start();

            Fireball          = GameObject.Find("Fireball");
            Timer             = GetComponent <Timer>();
            ParticleComponent = Fireball.GetComponent <ParticleSystem>();
            MainModule        = ParticleComponent.main;
            Fireball.SetActive(false);
            LightSource = Fireball.transform.GetChild(0).GetComponent <Light>();

            TargetSchema = new TargetSchema(
                1,
                CombatantType.Enemy,
                SelectorType.Number);
        }
Пример #8
0
    public new void Start()
    {
        base.Start();
        Timer = GetComponent <Timer>();

        Arrows    = new GameObject[4];
        Arrows[0] = GameObject.Find("Up Arrow");
        Arrows[1] = GameObject.Find("Down Arrow");
        Arrows[2] = GameObject.Find("Left Arrow");
        Arrows[3] = GameObject.Find("Right Arrow");

        foreach (GameObject arrow in Arrows)
        {
            print(arrow);
            arrow.SetActive(false);
        }


        TargetSchema = new TargetSchema(
            0,
            CombatantType.Ally,
            SelectorType.All);
    }
Пример #9
0
    public new void Start()
    {
        base.Start();
        Timer = GetComponent <Timer>();
        ReloadCanvas.gameObject.SetActive(false);
        ShootingCanvas.gameObject.SetActive(false);
        IsBulletReserved  = new bool[BulletPositions.Length];
        IsPimpkinReserved = new bool[PimpkinSpawnLocations.Length];
        BulletUIInReload  = ReloadCanvas.GetComponentsInChildren <DragAndDrop>();
        Pimpkins          = ShootingCanvas.GetComponentsInChildren <PimpkinHead>();
        RevolverNozzle    = GameObject.Find("RevolverNozzle").transform;


        for (int i = 0; i < BulletUIInShoot.Length; i++)
        {
            BulletUIInShoot[i].SetActive(false);
        }

        TargetSchema = new TargetSchema(
            1,
            CombatantType.Enemy,
            SelectorType.Number);
    }
Пример #10
0
        private void OkCommand_Executed(object state)
        {
            Mapping mapping;

            if (IsNew)
            {
                mapping = new Mapping(Column.Input, Column.Output);
            }
            else
            {
                mapping = Column.Definition.Mapping;
            }

            // For each entry decide what to do with the corresponding 1. match in the mapping 2. target column, depending on the comparision with the existing 1. match, target column
            foreach (var entry in SourceColumnEntries)
            {
                DcColumn sourceColumn = entry.Source;

                PathMatch match = mapping.GetMatchForSource(new DimPath(sourceColumn));

                DcColumn targetColumn;

                if (entry.IsMatched && match == null) // Newly added. Creation
                {
                    DcTable targetType       = entry.TargetType;
                    string  targetColumnName = sourceColumn.Name;
                    targetColumn = TargetSchema.CreateColumn(targetColumnName, Column.Output, targetType, entry.IsKey);
                    targetColumn.Add();

                    mapping.AddMatch(new PathMatch(new DimPath(sourceColumn), new DimPath(targetColumn)));
                }
                else if (!entry.IsMatched && match != null) // Newly removed. Deletion.
                {
                    targetColumn = match.TargetPath.FirstSegment;
                    targetColumn.Remove();

                    mapping.RemoveMatch(match.SourcePath, match.TargetPath);
                }
                else if (entry.IsMatched) // Remains included. Update properties (name, key, type etc.)
                {
                    targetColumn = match.TargetPath.FirstSegment;
                    if (targetColumn.Output != entry.TargetType) // Type has been changed
                    {
                        targetColumn.Remove();
                        targetColumn.Output = entry.TargetType;
                        targetColumn.Add();
                    }
                }
                else // Remains excluded
                {
                }
            }

            Column.Name        = NewColumnName;
            Column.Output.Name = NewTableName;

            if (IsNew)
            {
                Column.Definition.DefinitionType = DcColumnDefinitionType.LINK;
                Column.Definition.Mapping        = mapping;
                Column.Definition.IsAppendData   = true;
                Column.Add();

                Column.Output.Definition.DefinitionType = DcTableDefinitionType.PROJECTION;
                TargetSchema.AddTable(Column.Output, null, null);
            }

            this.DialogResult = true;
        }
Пример #11
0
        private void Initialize() // Initialize dialog after context change (source table or column)
        {
            NewTableName = Column.Output.Name;

            NewColumnName = Column.Name;

            SourceColumnEntries.Clear();

            if (Column.Input == null)
            {
                return; // Empty list if no source table
            }

            // Find a mapping
            Mapping mapping;

            if (IsNew)
            {
                if (Column.Definition.Mapping != null)
                {
                    mapping = Column.Definition.Mapping;
                }
                else
                {
                    Mapper mapper = new Mapper();
                    mapping = mapper.CreatePrimitive(Column.Input, Column.Output, TargetSchema); // Complete mapping (all to all)
                }
            }
            else // Edit
            {
                mapping = Column.Definition.Mapping;
                if (mapping == null)
                {
                    mapping = new Mapping(Column.Input, Column.Output);
                }
            }

            // Initialize a list of entries

            List <DcTable> targetTypes = new List <DcTable>();

            targetTypes.Add(TargetSchema.GetPrimitive("Integer"));
            targetTypes.Add(TargetSchema.GetPrimitive("Double"));
            targetTypes.Add(TargetSchema.GetPrimitive("String"));

            foreach (DcColumn sourceColumn in mapping.SourceSet.Columns)
            {
                if (sourceColumn.IsSuper)
                {
                    continue;
                }
                if (!sourceColumn.IsPrimitive)
                {
                    continue;
                }
                if (sourceColumn == Column)
                {
                    continue;                         // Do not include the generating/projection column
                }
                ImportMappingEntry entry = new ImportMappingEntry(sourceColumn);

                PathMatch match = mapping.GetMatchForSource(new DimPath(sourceColumn));

                entry.TargetTypes = targetTypes;

                if (match != null)
                {
                    entry.Target    = match.TargetPath.FirstSegment;
                    entry.IsMatched = true;
                    entry.IsKey     = entry.Target.IsKey;

                    entry.TargetType = entry.Target.Output;
                }
                else
                {
                    entry.Target    = null;
                    entry.IsMatched = false;

                    entry.IsKey = false;

                    // Recommend a type
                    if (sourceColumn.Output.Name == "Integer")
                    {
                        entry.TargetType = TargetSchema.GetPrimitive("Integer");
                    }
                    else if (sourceColumn.Output.Name == "Double")
                    {
                        entry.TargetType = TargetSchema.GetPrimitive("Double");
                    }
                    else if (sourceColumn.Output.Name == "String")
                    {
                        entry.TargetType = TargetSchema.GetPrimitive("String");
                    }
                }

                SourceColumnEntries.Add(entry);
            }
        }