Beispiel #1
0
        public vec2 DragonLordDeathGridCoord()
        {
            DyingDragonLordGridCoord.Apply(CurrentUnits, Output: Multigrid[0]);
            color packed = MultigridReduce(_BoundingTr.Apply);
            vec2  pos    = SimShader.unpack_vec2(packed);

            return(pos);
        }
Beispiel #2
0
        public int DoTotalUnitCount(float player, bool only_selected)
        {
            CountAllUnits.Apply(CurrentData, CurrentUnits, player, only_selected, Output: Multigrid[0]);

            color count = MultigridReduce(CountReduce_3byte1byte.Apply);

            return((int)(SimShader.unpack_val(count.xyz) + .5f));
        }
Beispiel #3
0
        public vec2 DragonLordPos(float player)
        {
            DragonLordGridCoord.Apply(CurrentUnits, player, Output: Multigrid[0]);

            color packed = MultigridReduce(_PreferTl.Apply);

            vec2 pos = SimShader.unpack_vec2_corrected(packed);

            return(pos + vec(0.5f, 0.75f));
        }
Beispiel #4
0
        /// <summary>
        /// Warning: This is not network synchronized. Should only affect local clients fake selection field or the information should be communicated over the network.
        /// </summary>
        public void SelectedUnitsBounds()
        {
            BoundingTr.Apply(CurrentData, Output: Multigrid[0]);
            color bound_tr = MultigridReduce(_BoundingTr.Apply);

            BoundingBl.Apply(CurrentData, Output: Multigrid[0]);
            color bound_bl = MultigridReduce(_BoundingBl.Apply);

            SelectedBound_TR = SimShader.unpack_vec2(bound_tr);
            SelectedBound_BL = SimShader.unpack_vec2(bound_bl);
        }
Beispiel #5
0
        public Tuple <int, int> DoUnitCount(float player, bool only_selected)
        {
            CountUnits.Apply(CurrentData, CurrentUnits, player, only_selected, Output: Multigrid[0]);

            color count = MultigridReduce(CountReduce_3byte1byte.Apply);

            int unit_count     = (int)(SimShader.unpack_val(count.xyz) + .5f);
            int barracks_count = Int(count.w);

            return(new Tuple <int, int>(unit_count, barracks_count));
        }