Esempio n. 1
0
        private List <MedicalVendorInvoiceStatistic> FetchInvoiceStatistics(IRelationPredicateBucket bucket)
        {
            var physicianInvoiceEntities           = new EntityCollection <PhysicianInvoiceEntity>();
            var medicalVendorInvoiceItemStatistics = new DataTable("MedicalVendorInvoiceItemStatisticsDataTable");

            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                IPrefetchPath2 path = new PrefetchPath2(EntityType.PhysicianInvoiceEntity);
                path.Add(PhysicianInvoiceEntity.PrefetchPathPhysicianProfile);
                myAdapter.FetchEntityCollection(physicianInvoiceEntities, bucket, path);

                long[] medicalVendorInvoiceIds = physicianInvoiceEntities.Select(i => i.PhysicianInvoiceId).ToArray();
                if (!medicalVendorInvoiceIds.IsEmpty())
                {
                    IRelationPredicateBucket medicalVendorInvoiceItemBucket = new RelationPredicateBucket
                                                                                  (PhysicianInvoiceItemFields.PhysicianInvoiceId == medicalVendorInvoiceIds);

                    OrderedPair <ResultsetFields, GroupByCollection> resultsetFieldsAndGroupByCollection = _medicalVendorInvoiceStatisticFactory.
                                                                                                           CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClause();

                    myAdapter.FetchTypedList(resultsetFieldsAndGroupByCollection.FirstValue, medicalVendorInvoiceItemStatistics,
                                             medicalVendorInvoiceItemBucket, 0, null, true, resultsetFieldsAndGroupByCollection.SecondValue);
                }
            }
            return(_medicalVendorInvoiceStatisticFactory.CreateMedicalVendorInvoiceStatistics(physicianInvoiceEntities,
                                                                                              medicalVendorInvoiceItemStatistics));
        }
        public ECall GetCallCenterEntity(long callId)
        {
            using (var adapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData = new LinqMetaData(adapter);
                var call         = (from c in linqMetaData.Calls where c.CallId == callId select c).FirstOrDefault();

                if (call == null)
                {
                    throw new Exception("No call found for the given call Id");
                }

                var couponCode = string.Empty;
                if (call.PromoCodeId != null)
                {
                    couponCode =
                        (from c in linqMetaData.Coupons where c.CouponId == call.PromoCodeId.Value select c.CouponCode).
                        FirstOrDefault();
                }

                var orderedPair = new OrderedPair <CallsEntity, string>(call, couponCode);

                var factory = new ECallFactory();
                return(factory.Create(orderedPair));
            }
        }
        public List <OrderedPair <DateTime, DateTime> > GetMedicalVendorInvoicePayPeriods(long organizationRoleUserId,
                                                                                          PaymentStatus paymentStatus)
        {
            var payPeriodFields = new ResultsetFields(2);

            payPeriodFields.DefineField(PhysicianInvoiceFields.PayPeriodStartDate, 0);
            payPeriodFields.DefineField(PhysicianInvoiceFields.PayPeriodEndDate, 1);
            var payPeriodsDataTable         = new DataTable("Medical Vendor Invoice Pay Periods");
            IRelationPredicateBucket bucket = new RelationPredicateBucket
                                                  (PhysicianInvoiceFields.PhysicianId == organizationRoleUserId);

            bucket.PredicateExpression.Add(PhysicianInvoiceFields.PaymentStatus == (byte)paymentStatus);

            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                myAdapter.FetchTypedList(payPeriodFields, payPeriodsDataTable, bucket, false);
            }

            var payPeriods = new List <OrderedPair <DateTime, DateTime> >();

            foreach (DataRow row in payPeriodsDataTable.Rows)
            {
                var orderedPair = new OrderedPair <DateTime, DateTime>((DateTime)row["PayPeriodStartDate"],
                                                                       (DateTime)row["PayPeriodEndDate"]);
                payPeriods.Add(orderedPair);
            }
            return(payPeriods);
        }
Esempio n. 4
0
        public void PublishSendTestMediaFiles(long eventId, long customerId)
        {
            IDatabase   db  = RedisConnection.ConnectionMultiplexer.GetDatabase(_settings.RedisDatabaseKey);
            ISubscriber sub = RedisConnection.ConnectionMultiplexer.GetSubscriber();

            var orderedPair = new OrderedPair <long, long>()
            {
                FirstValue  = eventId,
                SecondValue = customerId
            };
            var serialisedObject = Newtonsoft.Json.JsonConvert.SerializeObject(orderedPair);

            db.ListLeftPush(RequestSubcriberChannelNames.IpCopyMediaFilesQueue, serialisedObject);

            try
            {
                sub.Publish(RequestSubcriberChannelNames.IpCopyMediaFilesChannel, "", CommandFlags.FireAndForget);
                Thread.Sleep(1000);
            }
            catch (Exception ex)
            {
                var length = db.ListLength(RequestSubcriberChannelNames.IpCopyMediaFilesQueue);

                if (length > 0)
                {
                    _logger.Error("Queue name:" + RequestSubcriberChannelNames.IpCopyMediaFilesQueue + " and Length:" + length);
                    db.ListLeftPop(RequestSubcriberChannelNames.IpCopyMediaFilesQueue);
                }
                _logger.Error("Exception occurred while publishing Send Test Media Files. Message: " + ex.Message);
                _logger.Error("Stack Trace: " + ex.StackTrace);
            }
        }
        public OrderedPair <bool, bool> GetSmokerDiabeticInformation(long customerId)
        {
            OrderedPair <bool, bool> smokerDiabeticInformation;

            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData       = new LinqMetaData(myAdapter);
                var smokerDiabeticData = from healthInformation in linqMetaData.CustomerHealthInfo
                                         where healthInformation.CustomerId == customerId
                                         select new
                {
                    Id    = healthInformation.CustomerHealthQuestionId,
                    Value = healthInformation.HealthQuestionAnswer
                };
                if (smokerDiabeticData.Count() <= 0)
                {
                    return(null);
                }
                smokerDiabeticData = smokerDiabeticData.Where
                                         (smokerDiabetic => smokerDiabetic.Id == 1025 || smokerDiabetic.Id == 1030);
                smokerDiabeticInformation = new OrderedPair <bool, bool>(false, false);
                foreach (var data in smokerDiabeticData)
                {
                    if (data.Id == 1025)
                    {
                        smokerDiabeticInformation.FirstValue = data.Value == "No" ? false : true;
                    }
                    if (data.Id == 1030)
                    {
                        smokerDiabeticInformation.SecondValue = data.Value == "No" ? false : true;
                    }
                }
            }
            return(smokerDiabeticInformation);
        }
Esempio n. 6
0
        public void TestOrderedPairGetters()
        {
            IPair a = new OrderedPair(1, 2);

            Assert.IsTrue(a.First.Equals(1));
            Assert.IsTrue(a.Second.Equals(2));
        }
Esempio n. 7
0
        public StatusMenu(Entity _entity)
        {
            Size     = new OrderedPair(200, 150);
            Position = new OrderedPair(400, 200);

            entity = _entity;
            Refresh();
        }
Esempio n. 8
0
        public void TestInterPairEquals()
        {
            IPair a = new OrderedPair(1, 2);
            IPair b = new UnorderedPair(1, 2);

            Assert.IsTrue(!a.Equals(b));
            Assert.IsTrue(!b.Equals(a));
        }
Esempio n. 9
0
        public void GetLifetimeNumberOfEarningsAndTotalAmountEarnedForUserReturnsValuesWhenGivenValidId()
        {
            OrderedPair <int, decimal> numberOfEarningsAndAmountEarned = _medicalVendorEarningRepository.
                                                                         GetNumberOfEarningsAndTotalAmountEarnedForUser(VALID_ORGANIZATION_ROLE_USER_ID);

            Assert.AreNotEqual(0, numberOfEarningsAndAmountEarned.FirstValue);
            Assert.AreNotEqual(0m, numberOfEarningsAndAmountEarned.SecondValue);
        }
Esempio n. 10
0
        public void AddItem(IOrderable itemToOrder, int quantity, long forOrganizationRoleUserId,
                            long dataRecorderCreatorId, SourceCode sourceCode, EventCustomer eventCustomer,
                            ShippingDetail shippingDetail, OrderStatusState orderStatusState, long?sourceId = null)
        {
            if (sourceId == null && (itemToOrder is EventPackage || itemToOrder is EventTest))
            {
                var customerId = forOrganizationRoleUserId;
                if (itemToOrder is EventTest)
                {
                    var preApprovedTestList = _preApprovedTestRepository.GetByCustomerId(customerId).Select(x => x.TestId);
                    if (preApprovedTestList.Contains(((EventTest)itemToOrder).TestId))
                    {
                        sourceId = (long)OrderSource.PreApproved;
                    }
                }
                else if (itemToOrder is EventPackage)
                {
                    var preApprovedPackageList = _preApprovedPackageRepository.GetByCustomerId(customerId).Select(x => x.PackageId);
                    if (preApprovedPackageList.Contains(((EventPackage)itemToOrder).PackageId))
                    {
                        sourceId = (long)OrderSource.PreApproved;
                    }
                }
                if (sourceId == null)
                {
                    var oru = _organizationRoleUserRepository.GetOrganizationRoleUser(dataRecorderCreatorId);
                    if (oru.RoleId == (long)Roles.FranchiseeAdmin)
                    {
                        sourceId = (long)OrderSource.Admin;
                    }
                    else if (oru.RoleId == (long)Roles.CallCenterRep)
                    {
                        sourceId = (long)OrderSource.CallCenter;
                    }
                    else if (oru.RoleId == (long)Roles.Technician)
                    {
                        sourceId = (long)OrderSource.Technician;
                    }
                    else if (oru.RoleId == (long)Roles.NursePractitioner)
                    {
                        sourceId = (long)OrderSource.NursePractioner;
                    }
                }
            }


            OrderDetail orderDetail = _orderDetailFactory.CreateNewOrderDetail(itemToOrder, quantity,
                                                                               forOrganizationRoleUserId,
                                                                               dataRecorderCreatorId,
                                                                               sourceCode, eventCustomer, shippingDetail, sourceId);

            orderDetail.OrderItemStatus = _orderItemStatusFactory.CreateOrderItemStatus(itemToOrder.OrderItemType,
                                                                                        (int)orderStatusState);

            var pair = new OrderedPair <OrderDetail, IOrderable>(orderDetail, itemToOrder);

            _lineItems.Add(pair);
        }
Esempio n. 11
0
        public void OrderedPairToStringTest()
        {
            var p = new OrderedPair <int>(
                new Singleton <int>(1),
                new Singleton <int>(2)
                );

            Assert.AreEqual("{1, {1, 2}}", p.ToString());
        }
        public void CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClauseGroupsByEvaluationEndTime()
        {
            OrderedPair <ResultsetFields, GroupByCollection> resultsetFieldsAndGroupByClause = _medicalVendorInvoiceStatisticFactory.
                                                                                               CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClause();

            //string expectedName = PhysicianInvoiceItemFields.EvaluationEndTime.Name;
            //Assert.IsTrue(resultsetFieldsAndGroupByClause.SecondValue.Where(gbc => gbc.Name ==
            //    expectedName).Count() == 1, "GroupByClause does not contain {0}.", expectedName);
        }
        public void CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClauseReturnsGroupByClauseWith3Items()
        {
            const int expectedNumberOfGroupByItems = 3;
            OrderedPair <ResultsetFields, GroupByCollection> resultsetFieldsAndGroupByClause = _medicalVendorInvoiceStatisticFactory.
                                                                                               CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClause();

            int numberOfItemsInGroupByClause = resultsetFieldsAndGroupByClause.SecondValue.Count;

            Assert.IsTrue(numberOfItemsInGroupByClause == expectedNumberOfGroupByItems,
                          "Expected {0} but {1} returned.", expectedNumberOfGroupByItems, numberOfItemsInGroupByClause);
        }
        public void CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClauseReturnsResultsetWith5Rows()
        {
            const int expectedNumberOfResultsetFields = 5;
            OrderedPair <ResultsetFields, GroupByCollection> resultsetFieldsAndGroupByClause = _medicalVendorInvoiceStatisticFactory.
                                                                                               CreateMedicalVendorInvoiceStatisticFieldsAndGroupByClause();

            int numberOfResultsetFields = resultsetFieldsAndGroupByClause.FirstValue.Count;

            Assert.IsTrue(numberOfResultsetFields == expectedNumberOfResultsetFields,
                          "Expected {0} but {1} returned.", expectedNumberOfResultsetFields, numberOfResultsetFields);
        }
Esempio n. 15
0
        public BookMenu(string _bookId)
        {
            IncrementControl = Control.Right;
            DecrementControl = Control.Left;

            bookId = _bookId;

            Size = new OrderedPair(500, 500);

            // add two blank lines
            Text = GetPageText(0);
        }
Esempio n. 16
0
        public void TestOrderedPairEquals()
        {
            IPair a = new OrderedPair(1, 2);

            Assert.IsTrue(a.Equals(a));
            Assert.IsTrue(!a.Equals(null));
            IPair b = new OrderedPair(1, 2);

            Assert.IsTrue(a.Equals(b));
            Assert.IsTrue(b.Equals(a));
            Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
        }
Esempio n. 17
0
        /// <summary>
        /// returns the team communication path.
        /// If no team classifier is provided, the developer himself is used.
        /// </summary>
        public Dictionary <OrderedPair, uint> AnalyzeTeamCommunication(ChangeSetHistory history, ITeamClassifier teamClassifier)
        {
            // file id -> dictionary{team, #commits}
            var fileToCommitsPerTeam = new Dictionary <string, Dictionary <string, uint> >();

            foreach (var cs in history.ChangeSets)
            {
                // Associated team (or developer)
                var team = GetTeam(cs, teamClassifier);

                foreach (var item in cs.Items)
                {
                    // Add team to file
                    if (!fileToCommitsPerTeam.Keys.Contains(item.Id))
                    {
                        fileToCommitsPerTeam.Add(item.Id, new Dictionary <string, uint>());
                    }

                    var commitsPerTeam = fileToCommitsPerTeam[item.Id];
                    commitsPerTeam.AddToValue(team, 1);
                }
            }

            // We know for each file which team did how many changes
            // Each file that was accessed by two teams leads to a link between the teams.

            // pair of teams -> number of commits.
            var teamCommunicationPaths = new Dictionary <OrderedPair, uint>();

            foreach (var file in fileToCommitsPerTeam)
            {
                var currentFileTeams = file.Value.Keys.ToList();

                // Build team subsets that get counted as one path.
                for (var index = 0; index < currentFileTeams.Count - 1; index++)
                {
                    for (var index2 = 1; index2 < currentFileTeams.Count; index2++)
                    {
                        var teamPair = new OrderedPair(currentFileTeams[index], currentFileTeams[index2]);

                        // The team combination that worked together at least one time at the same file
                        // gets a point.
                        teamCommunicationPaths.AddToValue(teamPair, 1);
                    }
                }
            }

            return(teamCommunicationPaths);
        }
Esempio n. 18
0
        public override void Refresh()
        {
            Attributes attributes = entity.GetComponent <Attributes>();

            Text = $"P: {attributes.Prowess}\n" +
                   $"F: {attributes.Concentration}\n" +
                   $"C: {attributes.Concentration}\n" +
                   $"V: {attributes.Vigor}\n\n" +

                   $"Health: {attributes.Health}/{attributes.MaxHealth}";

            Random rand = new Random();

            Position += new OrderedPair(rand.Next(-2, 3), rand.Next(-2, 3));
        }
Esempio n. 19
0
        public OrderedPair <List <Package>, List <Test> > GetPackagesAndTests(long eventId, long roleId)
        {
            IEventPackageRepository packageRepository = new EventPackageRepository();
            var eventPackages =
                packageRepository.GetPackagesForEventByRole(eventId, roleId).OrderByDescending(p => p.Price);
            var packages = eventPackages.Select(ep => ep.Package).ToList();

            IEventTestRepository eventTestRepository = new EventTestRepository();
            var eventTests = eventTestRepository.GetTestsForEventByRole(eventId, roleId);
            var tests      = eventTests.Select(et => et.Test).ToList();

            var packagesAndTests = new OrderedPair <List <Package>, List <Test> >(packages, tests);

            return(packagesAndTests);
        }
Esempio n. 20
0
        /// <summary>
        ///     File or classification. The given items occur together in a changeset.
        /// </summary>
        private void IncrementCoupling(string item1, string item2)
        {
            var pairKey = OrderedPair.Key(item1, item2);

            Coupling coupling;

            if (_couplings.TryGetValue(pairKey, out coupling))
            {
                coupling.Couplings = coupling.Couplings + 1;
            }
            else
            {
                _couplings.Add(pairKey, new Coupling(item1, item2));
            }
        }
Esempio n. 21
0
        private bool IsPreApprovedPackageUpdated(OrderedPair <long, long> eventPackagePair, IEnumerable <EventPackage> eventPackages, Order order, long preApprovedPackageId)
        {
            if (preApprovedPackageId <= 0)
            {
                return(false);
            }

            if (eventPackagePair == null)
            {
                return(true);
            }

            var package = eventPackages.First(x => x.Id == eventPackagePair.SecondValue).Package;

            return(package.Id != preApprovedPackageId);
        }
        public void GetTerritoryReturnsWhatRepositoryGetTerritoryReturnsForTerritory()
        {
            const long territoryId       = 3;
            Territory  expectedTerritory = new SalesRepTerritory(territoryId);

            Expect.Call(_territoryRepository.GetTerritory(territoryId)).Return(expectedTerritory);
            Expect.Call(_territoryRepository.GetOwnerNamesForTerritory(expectedTerritory)).Return(new List <string>());

            _mocks.ReplayAll();
            OrderedPair <Territory, List <string> > territoryAndOwnerNames = _territoryController.
                                                                             GetTerritoryAndOwnerNames(territoryId);

            _mocks.VerifyAll();

            Assert.AreEqual(expectedTerritory, territoryAndOwnerNames.FirstValue, "Incorrect territory returned.");
        }
Esempio n. 23
0
        private OrderedPair <string, string> GetFormTypeMediaPathAndFormName(PatientFormType formType)
        {
            var retString = new OrderedPair <string, string>();

            switch (formType)
            {
            case PatientFormType.Chaperone:
                retString.FirstValue  = "Chaperone";
                retString.SecondValue = Chaperone;
                break;

            default:
                retString.FirstValue  = formType.ToString();
                retString.SecondValue = formType.ToString();
                break;
            }
            return(retString);
        }
        public IEnumerable <SalesRepTerritoryAssignment> CreateSalesRepTerritoryAssignments
            (IEnumerable <OrderedPair <OrganizationRoleUser, RegistrationMode> > owningUsersAndEventTypes,
            IEnumerable <OrderedPair <long, long> > userSalesReps)
        {
            var salesRepTerritoryAssignments = new List <SalesRepTerritoryAssignment>();

            foreach (var owningUserAndEventType in owningUsersAndEventTypes)
            {
                OrderedPair <OrganizationRoleUser, RegistrationMode> type = owningUserAndEventType;
                long salesRepId = userSalesReps.
                                  Single(user => user.FirstValue == type.FirstValue.UserId).SecondValue;
                SalesRepTerritoryAssignment assignment = CreateSalesRepTerritoryAssignment
                                                             (owningUserAndEventType.FirstValue.UserId, owningUserAndEventType.SecondValue,
                                                             salesRepId);
                salesRepTerritoryAssignments.Add(assignment);
            }
            return(salesRepTerritoryAssignments);
        }
Esempio n. 25
0
     public static void Main(){
       List<double> oneCoords=new List<double>(){1,2};
       List<double> otherCoords= new List<double>(){2,3};
 
 
       OrderedPair one = new OrderedPair(oneCoords);
       OrderedPair another = new OrderedPair(otherCoords);
       OrderedPair sum1 = new OrderedPair(one + another);
 
 
       Console.WriteLine(one.Coords[0].ToString()+one.Coords[1].ToString());
       Console.WriteLine(sum1.Coords[0].ToString()+sum1.Coords[1].ToString());
 
       bool test = one > another;
       Console.WriteLine(test);
       bool test2 = one < another;
       Console.WriteLine(test2);
     }
Esempio n. 26
0
        public List <OrderedPair <short, string> > GetAllProspectContactRole()
        {
            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData = new LinqMetaData(myAdapter);
                var organizationRoleUserEntities = linqMetaData.ProspectContactRole;
                var listproscontrole             = new List <OrderedPair <short, string> >();

                foreach (var drproscont in organizationRoleUserEntities)
                {
                    var objproscontrole = new OrderedPair <short, string>();
                    objproscontrole.FirstValue  = (short)drproscont.ProspectContactRoleId;
                    objproscontrole.SecondValue = drproscont.ProspectContactRoleName;
                    listproscontrole.Add(objproscontrole);
                }
                return(listproscontrole);
            }
        }
        public void GetTerritorySetsListOfOwnersToWhatGetOwnersRepositoryMethodReturns()
        {
            const long territoryId        = 3;
            Territory  expectedTerritory  = new SalesRepTerritory(territoryId);
            var        expectedOwnerNames = new List <string> {
                "Bob", "Alice"
            };

            Expect.Call(_territoryRepository.GetTerritory(territoryId)).Return(expectedTerritory);
            Expect.Call(_territoryRepository.GetOwnerNamesForTerritory(expectedTerritory)).Return(expectedOwnerNames);

            _mocks.ReplayAll();
            OrderedPair <Territory, List <string> > territoryAndOwnerNames = _territoryController.
                                                                             GetTerritoryAndOwnerNames(territoryId);

            _mocks.VerifyAll();

            Assert.AreEqual(expectedOwnerNames, territoryAndOwnerNames.SecondValue, "Incorrect owner list returned.");
        }
Esempio n. 28
0
        public static List <Entity> GetEntitiesAtPosition(OrderedPair p)
        {
            List <Entity> objectsAtPos = new List <Entity>();

            foreach (Entity o in entities)
            {
                // if the entity doesn't have a position, continue
                if (!o.HasComponent <Position>())
                {
                    continue;
                }

                if (o.GetComponent <Position>().Pos.Equals(p))
                {
                    objectsAtPos.Add(o);
                }
            }

            return(objectsAtPos);
        }
Esempio n. 29
0
        public ECall Create(OrderedPair <CallsEntity, string> entityOrderedPair)
        {
            var entity = entityOrderedPair.FirstValue;

            return(new ECall()
            {
                CallBackNumber = entity.CallBackNumber,
                CallCenterCallCenterUserID = entity.CreatedByOrgRoleUserId,
                CalledCustomerID = entity.CalledCustomerId != null ? entity.CalledCustomerId.Value : 0,
                CallersPhoneNumber = entity.CallersPhoneNumber,
                CallID = entity.CallId,
                EventID = entity.EventId != null ? entity.EventId.Value : 0,
                IncomingPhoneLine = entity.IncomingPhoneLine,
                IsNewCustomer = entity.IsNewCustomer != null ? entity.IsNewCustomer.Value : false,
                CallStatus = entity.CallStatus,
                OutBound = entity.OutBound != null ? entity.OutBound.Value : false,
                TimeCreated = entity.TimeCreated != null?entity.TimeCreated.ToString() : string.Empty,
                                  SourceCode = entityOrderedPair.SecondValue
            });
        }
Esempio n. 30
0
        void ISystem.OperateOnEntity(Entity e)
        {
            EnergyHaver energyComp = e.GetComponent <EnergyHaver>();
            AI          ai         = e.GetComponent <AI>();

            // keep taking moves until out of energy
            while (energyComp.CanTakeAction())
            {
                // assign a target if needed
                if (ai.Target == null)
                {
                    AssignTarget(e);
                }

                if (ai.State == AIState.Pursuing)
                {
                    Position posComp       = e.GetComponent <Position>();
                    Position targetPosComp = ai.Target.GetComponent <Position>();

                    // if the entity is adjacent to its target
                    if (OrderedPair.Adjacent(posComp.Pos, targetPosComp.Pos))
                    {
                        // attack the target
                        energyComp.Energy -= GameManager.COST_ATTACK;
                        AttackFunctions.BumpAttack(e, ai.Target);
                    }
                    else
                    {
                        // move towards the target
                        energyComp.Energy -= GameManager.COST_MOVE;
                        OrderedPair towards = OrderedPair.Towards(posComp.Pos, targetPosComp.Pos);
                        MoveFunctions.Move(e, posComp.Pos + towards);
                    }

                    continue;
                }

                break;
            }
        }