Beispiel #1
0
        private void ChangeRot()
        {
            var idxCurr = ROTS.IndexOf(Normal);

            for (int i = 1; i < ROTS.Length; i++)
            {
                var idxTest = (idxCurr + i) % ROTS.Length;
                if (GDOwner.CanInsertPortalStub(Position, Length, ROTS[idxTest], this) != null)
                {
                    Normal = ROTS[idxTest];
                    return;
                }
            }
        }
Beispiel #2
0
        private void ChangeLen()
        {
            float nextlen = (GDConstants.TILE_WIDTH / 2f) * (FloatMath.Round(Length / (GDConstants.TILE_WIDTH / 2f)) + 1);

            if (nextlen > GDConstants.TILE_WIDTH * 4)
            {
                nextlen = (GDConstants.TILE_WIDTH / 2f);
            }

            if (GDOwner.CanInsertPortalStub(Position, nextlen, Normal, this) != null)
            {
                Length = nextlen;
            }
            else
            {
                Length = (GDConstants.TILE_WIDTH / 2f);
            }
        }