Example #1
0
        public static IIntersectionVisitor Create(
            IIntersector intersector,
            VisitorType type = VisitorType.IntersectionVisitor,
            TraversalModeType traversalMode = TraversalModeType.TraverseActiveChildren)

        {
            return(new IntersectionVisitor(intersector, type, traversalMode));
        }
Example #2
0
 protected IntersectionVisitor(
     IIntersector intersector,
     VisitorType type = VisitorType.IntersectionVisitor,
     TraversalModeType traversalMode = TraversalModeType.TraverseActiveChildren)
     : base(type, traversalMode)
 {
     SetIntersector(intersector);
 }
Example #3
0
        public void LoginAsAdmin()
        {
            Console.Write("Please enter login:"******"Please enter password:");

            if (true)
            {
                //
                this._visitorType = VisitorType.administrator;
            }
            else
            {
                //dispay
            }
        }
Example #4
0
        public void LoginAsUser()
        {
            Console.Write("Please enter login:"******"Please enter password:");

            if (true)
            {
                //
                this._visitorType = VisitorType.registeredUser;
            }
            else
            {
                //dispay
            }
        }
Example #5
0
        public static string GetGLUniqueKey(GLRecord objGLRecord, VisitorType visitorType, int newMemberId, int segmentId = 0)
        {
            switch (visitorType)
            {
            case VisitorType.Segment:
                Dictionary <int, int> SegmentValues = objGLRecord.GLMembers.SegmentValues.ToDictionary(x => x.Key, x => x.Value);
                if (SegmentValues != null && segmentId != 0)
                {
                    if (SegmentValues.ContainsKey(segmentId))
                    {
                        SegmentValues[segmentId] = newMemberId;
                    }
                    return(string.Format("{0}{1}{2}", objGLRecord.ScenarioId, objGLRecord.ReportingId, string.Concat(SegmentValues.OrderBy(o => o.Key).Select(s => s.Value.ToString()))));
                }
                return(objGLRecord.UniqueKey);

            default: return(objGLRecord.UniqueKey);
            }
        }
Example #6
0
 /// <summary>
 /// Sets the given participant to reference the person as a participant.
 /// </summary>
 /// <param name="participant">The participant to update.</param>
 protected override void UpdateParticipantDetails(Participant participant, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
 {
     participant.OrganizationId    = null;
     participant.PersonId          = this.PersonId;
     participant.ParticipantPerson = new ParticipantPerson
     {
         Participant = participant
     };
     if (visitorType != null && visitorType.VisitorTypeId == VisitorType.ExchangeVisitor.Id)
     {
         participant.ParticipantExchangeVisitor = new ParticipantExchangeVisitor
         {
             Participant       = participant,
             ParticipantPerson = participant.ParticipantPerson
         };
         if (defaultExchangeVisitorFunding != null)
         {
             participant.ParticipantExchangeVisitor.FundingSponsor       = defaultExchangeVisitorFunding.FundingSponsor;
             participant.ParticipantExchangeVisitor.FundingPersonal      = defaultExchangeVisitorFunding.FundingPersonal;
             participant.ParticipantExchangeVisitor.FundingVisGovt       = defaultExchangeVisitorFunding.FundingVisGovt;
             participant.ParticipantExchangeVisitor.FundingVisBNC        = defaultExchangeVisitorFunding.FundingVisBNC;
             participant.ParticipantExchangeVisitor.FundingGovtAgency1   = defaultExchangeVisitorFunding.FundingGovtAgency1;
             participant.ParticipantExchangeVisitor.GovtAgency1Id        = defaultExchangeVisitorFunding.GovtAgency1Id;
             participant.ParticipantExchangeVisitor.GovtAgency1OtherName = defaultExchangeVisitorFunding.GovtAgency1OtherName;
             participant.ParticipantExchangeVisitor.FundingGovtAgency2   = defaultExchangeVisitorFunding.FundingGovtAgency2;
             participant.ParticipantExchangeVisitor.GovtAgency2Id        = defaultExchangeVisitorFunding.GovtAgency2Id;
             participant.ParticipantExchangeVisitor.GovtAgency2OtherName = defaultExchangeVisitorFunding.GovtAgency2OtherName;
             participant.ParticipantExchangeVisitor.FundingIntlOrg1      = defaultExchangeVisitorFunding.FundingIntlOrg1;
             participant.ParticipantExchangeVisitor.IntlOrg1Id           = defaultExchangeVisitorFunding.IntlOrg1Id;
             participant.ParticipantExchangeVisitor.IntlOrg1OtherName    = defaultExchangeVisitorFunding.IntlOrg1OtherName;
             participant.ParticipantExchangeVisitor.FundingIntlOrg2      = defaultExchangeVisitorFunding.FundingIntlOrg2;
             participant.ParticipantExchangeVisitor.IntlOrg2Id           = defaultExchangeVisitorFunding.IntlOrg2Id;
             participant.ParticipantExchangeVisitor.IntlOrg2OtherName    = defaultExchangeVisitorFunding.IntlOrg2OtherName;
             participant.ParticipantExchangeVisitor.FundingOther         = defaultExchangeVisitorFunding.FundingOther;
             participant.ParticipantExchangeVisitor.OtherName            = defaultExchangeVisitorFunding.OtherName;
             participant.ParticipantExchangeVisitor.FundingTotal         = defaultExchangeVisitorFunding.FundingTotal;
         }
     }
 }
Example #7
0
 public Visitor()
 {
     _visitorType = VisitorType.guest;
 }
Example #8
0
 /// <summary>
 /// Performs participant type specific logic.
 /// </summary>
 /// <param name="participant">The participant being created.</param>
 protected abstract void UpdateParticipantDetails(Participant participant, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding);
 /// <summary>
 /// Sets the given participant to reference the organization as a participant.
 /// </summary>
 /// <param name="participant">The participant to update.</param>
 protected override void UpdateParticipantDetails(Participant participant, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
 {
     participant.OrganizationId = this.OrganizationId;
     participant.PersonId       = null;
 }
 protected NodeVisitor(VisitorType type, TraversalModeType traversalMode = TraversalModeType.TraverseNone)
 {
     Type          = type;
     TraversalMode = traversalMode;
 }
Example #11
0
 public SpawnComponent(VisitorType visitorType)
 {
     this.VisitorType = visitorType;
 }
Example #12
0
 protected override void UpdateParticipantDetails(Data.Participant participant, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
 {
     this.UpdateParticipantDetailsCalled = true;
 }
Example #13
0
        public SmartEntity SpawnTroop(TroopTypeVO troopType, TeamType teamType, IntPosition boardPosition, TroopSpawnMode spawnMode, bool sendPlacedEvent, bool forceAllow, VisitorType visitorType)
        {
            Entity    spawnBuilding = null;
            BoardCell boardCell     = null;

            if (!this.FinalizeSafeBoardPosition(troopType, ref spawnBuilding, ref boardPosition, ref boardCell, teamType, spawnMode, forceAllow))
            {
                return(null);
            }
            SmartEntity smartEntity = Service.EntityFactory.CreateTroopEntity(troopType, teamType, boardPosition, spawnBuilding, spawnMode, true, true);

            if (smartEntity == null)
            {
                return(null);
            }
            SpawnComponent component = new SpawnComponent(visitorType);

            smartEntity.Add(component);
            BoardItemComponent boardItemComp = smartEntity.BoardItemComp;
            BoardItem          boardItem     = boardItemComp.BoardItem;

            if (Service.BoardController.Board.AddChild(boardItem, boardCell.X, boardCell.Z, null, false, !forceAllow && troopType.Type != TroopType.Champion) == null)
            {
                return(null);
            }
            Service.EntityController.AddEntity(smartEntity);
            Service.TroopAbilityController.OnTroopSpawned(smartEntity);
            if (troopType.Type != TroopType.Champion || teamType == TeamType.Attacker)
            {
                base.EnsureBattlePlayState();
            }
            if (sendPlacedEvent)
            {
                Service.EventManager.SendEvent(EventId.TroopPlacedOnBoard, smartEntity);
            }
            return(smartEntity);
        }
Example #14
0
        private Participant DoHandleAdditionalProjectParticipant(AdditionalProjectParticipant additionalProjectParticipant, ParticipantType participantType, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
        {
            var participant = new Participant();

            additionalProjectParticipant.UpdateParticipant(participant, participantType, visitorType, defaultExchangeVisitorFunding);
            additionalProjectParticipant.Audit.SetHistory(participant);
            Context.Participants.Add(participant);
            return(participant);
        }
Example #15
0
    public static int GetEffect(int towerID, int visitorID)      ///重复了啊啊啊啊啊!!need to recheck!!
    {
        int row, col;

        row = col = 0;
        VisitorType visitorType = (VisitorType)(visitorID / 100);
        TowerType   towerType   = (TowerType)(towerID / 100);

        switch (visitorType)
        {
        case VisitorType.em_Kid:
            row = (int)VisitorLineInExcel.em_KidLine;
            break;

        case VisitorType.em_Male:
            row = (int)VisitorLineInExcel.em_MaleLine;
            break;

        case VisitorType.em_Female:
            row = (int)VisitorLineInExcel.em_FemaleLine;
            break;

        case VisitorType.em_Senium:
            row = (int)VisitorLineInExcel.em_SeniumLine;
            break;

        case VisitorType.em_Alien:
            row = (int)VisitorLineInExcel.em_AlienLine;
            break;
        }
        row = row + visitorID % 100 - 1 - (int)VisitorLineInExcel.em_KidLine;

        switch (towerType)
        {
        case TowerType.em_ScenicSpot:
            col = (int)(TowerLineInExcel.em_ScenicSpotLine);
            break;

        case TowerType.em_Catering:
            col = (int)TowerLineInExcel.em_CateringLine;
            break;

        case TowerType.em_Accommodation:
            col = (int)TowerLineInExcel.em_AccommodationLine;
            break;

        case TowerType.em_Film:
            col = (int)TowerLineInExcel.em_FilmLine;
            break;

        case TowerType.em_Shopping:
            col = (int)TowerLineInExcel.em_ShoppingLine;
            break;

        case TowerType.em_Amusement:
            col = (int)TowerLineInExcel.em_AmusementLine;
            break;
        }
        col = col + (int)towerID % 100 - (int)(TowerLineInExcel.em_ScenicSpotLine) - 1;
        return(effectTable[row, col]);
    }
Example #16
0
 public void Logout()
 {
     this._visitorType = VisitorType.guest;
     //display
 }
        /// <summary>
        /// Setups the retrieve visit type list asynchronous.
        /// </summary>
        private void SetupRetrieveVisitTypeListAsync()
        {
            var visitTypeList = new ListResult<VisitorType>();
            var visitType = new VisitorType { VisitorTypeId = "1", Name = "Plumber" };
            visitTypeList.Items.Add(visitType);

            this.personRepository.Setup(a => a.RetrieveVisitorTypeListAsync()).Returns(Task.FromResult(visitTypeList));
        }
Example #18
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="participant"></param>
 protected override void UpdateParticipantDetails(Participant participant, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
 {
     Contract.Requires(participant != null, "The participant must not be null.");
 }
Example #19
0
 public SqlVisitor(DataBaseType dbType, int callIndex, VisitorType visitorType) : this(dbType, callIndex)
 {
     this.SqlVisitorType = visitorType;
 }
Example #20
0
 /// <summary>
 /// Updates the given participant with the AdditionalProjectParticipant details.
 /// </summary>
 /// <param name="participant">The participant that is being created.</param>
 /// <param name="participantType">The participant type.</param>
 public void UpdateParticipant(Participant participant, ParticipantType participantType, VisitorType visitorType, DefaultExchangeVisitorFunding defaultExchangeVisitorFunding)
 {
     Contract.Requires(participant != null, "The participant must not be null.");
     Contract.Requires(participantType != null, "The participant type must not be null.");
     participant.ProjectId           = this.ProjectId;
     participant.ParticipantStatusId = this.ParticipantStatusId;
     participant.ParticipantTypeId   = participantType.ParticipantTypeId;
     UpdateParticipantDetails(participant, visitorType, defaultExchangeVisitorFunding);
 }