Esempio n. 1
0
        public void SelectMovement(byte MovementNumber)
        {
            SelectedMovement = (MovementCategory)MovementNumber;

            if (SelectedAction != null)
            {
                Ready = true;
            }
        }
Esempio n. 2
0
        public void SelectMovement(MovementCategory Movement)
        {
            SelectedMovement = Movement;

            if (SelectedAction != null)
            {
                Ready = true;
            }
        }
Esempio n. 3
0
        public short RotationFromMovement(MovementCategory Movement)
        {
            short RotationDelta = 0;

            OldArenaOrientation = ArenaOrientation;

            if (Movement == MovementCategory.HOLD_GROUND)
            {
                if (PreviousMovement == MovementCategory.MOVE_LEFT)
                {
                    Movement = MovementCategory.MOVE_RIGHT;
                }
                else if (PreviousMovement == MovementCategory.MOVE_RIGHT)
                {
                    Movement = MovementCategory.MOVE_LEFT;
                }
            }

            PreviousMovement = Movement;

            if (Movement == MovementCategory.MOVE_LEFT)
            {
                if (ArenaOrientation == 0)
                {
                    ArenaOrientation = 7;
                }
                else
                {
                    ArenaOrientation--;
                }
                //-1
                RotationDelta = -1;
            }
            else if (Movement == MovementCategory.MOVE_RIGHT)
            {
                if (ArenaOrientation == 7)
                {
                    ArenaOrientation = 0;
                }
                else
                {
                    ArenaOrientation++;
                }
                //1
                RotationDelta = 1;
            }

            return(RotationDelta);
        }
Esempio n. 4
0
        public BattleEngine()
        {
            Player1 = new Player(1, 0);
            Player2 = new Player(2, 4);
            Player1.setStart(1);
            Player2.setStart(3);

            Interpreter = new EffectHardExecute(this);
            Network     = new BattleNetwork(null, 0);
            Network.StartOfflineClient();

            randomGen = new Random(0);

            Player1.playerServerNumber = 0;
            Player2.playerServerNumber = 1;

            for (int i = 0; i < 11; i++)
            {
                AllEffects[i] = new BattleTile();
            }

            for (int i = 0; i < 9; i++)
            {
                BattlePhases[i] = new BattlePhase(this, (byte)(i + 1));
            }

            pollIndex = 10;

            PreviousMovement    = MovementCategory.DO_NOTHING;
            OldArenaOrientation = 0;
            ArenaOrientation    = 0;

            SortedEffects = new Dictionary <EffectTrigger, SortedList <byte, List <BattleEffect> > >();
            foreach (EffectTrigger trigger in Enum.GetValues(typeof(EffectTrigger)))
            {
                SortedEffects[trigger] = new SortedList <byte, List <BattleEffect> >();
            }
        }
        public static Movement Create(int numberMovement, double stock, double price, DateTime aplicationDate, StatusMovement status, TypeMovement type,
                                      MovementCategory movementCategory, double previosCellarQty, double previousCellarAmount, double previousCellarStockQtyInv, double previousCellarStockAmountInv,
                                      double previousGeneralInvAmount, double previousGeneralStockAmount, Guid cellarId, Guid assetId, Guid?userId, Guid?inRequestId,
                                      Guid?outRequestId, Guid?adjustmentId, Guid?projectId, Guid creatorid, DateTime createDateTime, string companyName)
        {
            var @movement = new Movement
            {
                Id                           = Guid.NewGuid(),
                MovementNumber               = numberMovement,
                StockMovement                = stock,
                Price                        = price,
                ApplicationDateTime          = aplicationDate,
                Status                       = status,
                TypeMovement                 = type,
                MovementCategory             = movementCategory,
                PreviosCellarQty             = previosCellarQty,
                PreviousCellarAmount         = previousCellarAmount,
                PreviousCellarStockQtyInv    = previousCellarStockQtyInv,
                PreviousCellarStockAmountInv = previousCellarStockAmountInv,
                PreviousGeneralInvAmount     = previousGeneralInvAmount,
                PreviousGeneralStockAmount   = previousGeneralStockAmount,
                CellarId                     = cellarId,
                AssetId                      = assetId,
                UserId                       = userId,
                InRequestId                  = inRequestId,
                OutRequestId                 = outRequestId,
                AdjustmentId                 = adjustmentId,
                ProjectId                    = projectId,
                CreationTime                 = createDateTime,
                CreatorUserId                = creatorid,
                CompanyName                  = companyName,
                IsDeleted                    = false
            };

            return(@movement);
        }