public virtual long GenSequenceNumber(Context context)
        {
            if (context.PersistenceSession.Connection.State != ConnectionState.Open)
            {
                context.PersistenceSession.Connection.Open();
            }

            if (context.PersistenceSession.Connection.State != ConnectionState.Open)
            {
                throw new iSabayaException("Can't open connection using the given session.");
            }

            System.Data.IDbConnection adoCon = context.PersistenceSession.Connection;

            System.Data.IDbCommand genSeqNoCommand = adoCon.CreateCommand();
            genSeqNoCommand.CommandText = "declare @seqNo bigint; exec dbo.usp_GenSequenceNo "
                                          + ((int)context.MySystem.SystemID).ToString() + ","
                                          + SequenceType.ToString() + ","
                                          + SubsequenceType.ToString() + ", "
                                          + seed.ToString() + ", "
                                          + increment.ToString()
                                          + ",@seqNo output; select @seqNo";

            if (context.PersistenceSession.Transaction.IsActive)
            {
                context.PersistenceSession.Transaction.Enlist(genSeqNoCommand);
            }

            if (genSeqNoCommand.Connection.State != ConnectionState.Open)
            {
                genSeqNoCommand.Connection.Open();
            }
            return((long)genSeqNoCommand.ExecuteScalar());
        }
Beispiel #2
0
        private string ReplaceType(string yamlStruct, SequenceType seqType)
        {
            switch (seqType)
            {
            case SequenceType.Animation:
            case SequenceType.Combo:
            case SequenceType.HighScores:
            case SequenceType.LastScores:
            case SequenceType.RandomText:
            case SequenceType.ScriptedText:
                yamlStruct = yamlStruct.Replace("Sequence", seqType.ToString());
                break;

            case SequenceType.AnimationLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "animation_layer");
                break;

            case SequenceType.Credits:
                yamlStruct = yamlStruct.Replace("Sequence", "credits");
                break;

            case SequenceType.GroupLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "group_layer");
                break;

            case SequenceType.MarkupLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "markup_layer");
                break;

            case SequenceType.MoveLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "move_layer");
                break;

            case SequenceType.PanningLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "panning_layer");
                break;

            case SequenceType.ParticleLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "particle_layer");
                break;

            case SequenceType.TextLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "text_layer");
                break;

            case SequenceType.ZoomLayer:
                yamlStruct = yamlStruct.Replace("Sequence", "zoom_layer");
                break;

            default:
                break;
            }

            return(yamlStruct);
        }
 public virtual void ResetSequenceNumber(Context context)
 {
     if (resetCommand == null)
     {
         //String connectionString = ConfigurationSettings.AppSettings["strConnectionString"].ToString();
         //SqlConnection adoCon = new SqlConnection(connectionString);
         System.Data.IDbConnection adoCon = context.PersistenceSession.Connection;
         resetCommand             = adoCon.CreateCommand();
         resetCommand.CommandText = "exec dbo.usp_ResetSequenceNo "
                                    + SystemID.ToString() + ","
                                    + SequenceType.ToString() + ","
                                    + SubsequenceType.ToString() + ";";
     }
     resetCommand.ExecuteNonQuery();
 }
    void Make_newSystem(SequenceType argSequenceType, int argwrons)
    {
        BellHopGameEventManager.Instance.Call_DebugThis("w=" + argwrons.ToString() + " " + argSequenceType.ToString());


        TaskSys = new BHG_TaskSystem();
        _gs     = GameSettings.Instance;

        W_D_ExchandePos       = new TA_DwellerWarp(_Dweller, _exhangeI.GetActionPos());
        W_D_MAinRoomActionPos = new TA_DwellerWarp(_Dweller, _mainRoomActionI.GetActionPos());
        W_D_DancePos          = new TA_DwellerWarp(_Dweller, _danceI.GetActionPos());
        W_D_SpawnPos          = new TA_DwellerWarp(_Dweller, _spawnI.GetActionPos());

        M_D_ExchandePos       = new TA_DwellerMoveTo(_Dweller, _exhangeI.GetActionPos());
        M_D_MainRoomActionPos = new TA_DwellerMoveTo(_Dweller, _mainRoomActionI.GetActionPos());
        M_D_DancePos          = new TA_DwellerMoveTo(_Dweller, _danceI.GetActionPos());
        M_D_Outdoors          = new TA_DwellerMoveTo(_Dweller, _outDoorsPlace);
        F_D_Cam  = new TA_DwellerFace(_Dweller, Camera.main.transform);
        F_B_Cam  = new TA_DwellerFace(_Bellhop, Camera.main.transform);
        F_D_Bell = new TA_DwellerFace(_Dweller, _Bellhop.transform);
        F_D_MainRoomActionLookat = new TA_DwellerFace(_Dweller, _mainRoomActionI.GetLookTarg());
        F_B_Dweller     = new TA_DwellerFace(_Bellhop, _Dweller.transform);
        F_D_SpawnLookat = new TA_DwellerFace(_Dweller, _spawnI.GetLookTarg());
        //dweller pulls to his left AKA good delivery
        P_B_2R = new TA_DwellerPullCoord_2R(_Bellhop, _Dweller);
        P_D_2L = new TA_DwellerPullCoord_2L(_Dweller, _Bellhop);


        A_D_Wave1          = new TA_DwellerAnimate(_Dweller, _gs.Wave1);
        A_D_Wave2          = new TA_DwellerAnimate(_Dweller, _gs.Wave2);
        A_D_Hello          = new TA_DwellerAnimate(_Dweller, _gs.Hello);
        A_D_No             = new TA_DwellerAnimate(_Dweller, _gs.No);
        A_D_Good           = new TA_DwellerAnimate(_Dweller, _gs.Good);
        A_B_Good           = new TA_DwellerAnimate(_Bellhop, _gs.Good);
        A_D_MainRoomAction = new TA_DwellerAnimate(_Dweller, _mainRoomActionI.argActionString);
        A_D_Toss           = new TA_DwellerAnimate(_Dweller, _gs.Toss);
        A_B_Toss           = new TA_DwellerAnimate(_Bellhop, _gs.Toss);
        I_D_showRight      = new TA_InstantTaskHandShowHide(_Dweller, GameEnums.AnimalCharacterHands.Right, true);
        I_D_HideLeft       = new TA_InstantTaskHandShowHide(_Dweller, GameEnums.AnimalCharacterHands.Left, false);

        F_B_Cam = new TA_DwellerFace(_Bellhop, Camera.main.transform);

        O_DoorsNow           = new TA_TimedOpenDoor();
        T_moveOn             = new TA_MoveOnTrig(_Dweller, 4f);
        T_GG                 = new TA_GameOver();
        Sequence_SimpleGreet = new List <ITaskAction>
        {
            W_D_ExchandePos,
            M_D_ExchandePos,
            I_D_showRight,
            F_D_Bell,
            F_B_Dweller,
            A_D_Toss,
            P_B_2R,
            M_D_DancePos,
            F_D_Cam,
            F_D_Bell,
            F_B_Dweller,
            A_B_Toss,
            P_D_2L,
            F_B_Cam
        };


        Sequence_U_FIRST = new List <ITaskAction>   {
            W_D_MAinRoomActionPos,
            T_moveOn,
            F_D_MainRoomActionLookat,
            O_DoorsNow,
            A_D_MainRoomAction,
            F_D_Bell,
            M_D_ExchandePos,

            I_D_showRight,
            F_D_Bell,
            F_B_Dweller,
            A_D_Toss, //needed for pull mirorred character
            P_B_2R,
            F_D_Cam,
            F_B_Cam,
        };
        Sequence_U_Long_goodfloor = new List <ITaskAction>   {
            W_D_MAinRoomActionPos,
            T_moveOn,
            F_D_MainRoomActionLookat,
            O_DoorsNow,
            A_D_MainRoomAction,
            F_D_Bell,
            M_D_ExchandePos,
            I_D_showRight,
            F_B_Dweller,
            F_D_Bell,
            A_D_Hello,
            A_B_Toss, //needed for pull mirorred character
            P_D_2L,
            A_D_Good,
            I_D_HideLeft,
            I_D_showRight,
            A_D_Toss,
            P_B_2R,
            F_B_Cam,
        };

        Sequence_U_short_goodfloor = new List <ITaskAction>   {
            W_D_ExchandePos,
            I_D_showRight,
            O_DoorsNow,
            F_B_Dweller,
            F_D_Bell,
            M_D_ExchandePos,
            F_B_Dweller,
            F_D_Bell,
            A_B_Toss, //needed for pull mirorred character
            P_D_2L,
            A_D_Good,
            I_D_HideLeft,
            I_D_showRight,
            A_D_Toss,
            P_B_2R,
            F_B_Cam,
        };


        Sequence_U_goodfloor_fromSpaw = new List <ITaskAction>   {
            W_D_SpawnPos,
            F_D_SpawnLookat,
            I_D_showRight,
            O_DoorsNow,
            M_D_ExchandePos,

            F_B_Dweller,
            F_D_Bell,
            A_D_Hello,
            A_B_Toss, //needed for pull mirorred character
            P_D_2L,
            A_D_Good,
            I_D_HideLeft,
            I_D_showRight,
            A_D_Toss,
            P_B_2R,
            F_B_Cam,
        };

        Sequence_U_GameOver = new List <ITaskAction>   {
            W_D_MAinRoomActionPos,
            T_moveOn,
            F_D_MainRoomActionLookat,
            O_DoorsNow,
            A_D_MainRoomAction, //is running right after roomlookat , and hopes to get exited on time by O_DOOrnow
            F_D_Bell,
            A_D_Hello,
            A_B_Toss, //needed for pull mirorred character

            A_D_Good,
            A_B_Good,
            I_D_HideLeft,



            F_B_Cam,
            T_GG,
        };

        Sequence_U_WrongFloorLONG_walk = new List <ITaskAction>   {
            W_D_SpawnPos,
            F_D_SpawnLookat,
            O_DoorsNow,
            M_D_Outdoors,
            //    M_D_ExchandePos,
            F_B_Dweller,
            F_D_Bell,
            A_D_No,

            F_B_Cam,
            M_D_ExchandePos,
            F_D_Cam,
        };


        Sequence_Exc_DwellerToss1way_end = new List <ITaskAction>   {
            W_D_ExchandePos,
            O_DoorsNow,
            M_D_ExchandePos,
            F_D_Bell,
            F_B_Dweller,
            I_D_showRight,
            A_D_Toss, //needed for pull mirorred character
            P_B_2R,
            F_D_Cam,
            F_B_Cam,
        };
        Sequence_WrongFloor_Short = new List <ITaskAction>   {
            W_D_ExchandePos,

            O_DoorsNow,
            F_B_Dweller,
            F_D_Bell,
            A_D_No,

            F_B_Cam,
        };
        Sequence_WrongFloorLONG = new List <ITaskAction>   {
            //W_D_SpawnPos,
            //F_D_SpawnLookat,

            //O_DoorsNow,
            //M_D_ExchandePos,
            //F_B_Dweller,
            //F_D_Bell,
            //A_D_No,

            F_B_Cam,
        };



        if (argwrons == 0)
        {
            REF_correct = Sequence_U_short_goodfloor;
            REF_Wrong   = Sequence_WrongFloor_Short;
        }
        else

        if (argwrons == 1)
        {
            REF_correct = Sequence_U_Long_goodfloor;
            REF_Wrong   = Sequence_U_WrongFloorLONG_walk;
        }
        else
        {
            REF_correct = Sequence_U_goodfloor_fromSpaw;
            REF_Wrong   = Sequence_U_WrongFloorLONG_walk;
        }



        if (argSequenceType == SequenceType.sq_FIRST)
        {
            Setup_Tasksystem(Sequence_U_FIRST);
        }
        else

        if (argSequenceType == SequenceType.sq_correct)
        {
            Setup_Tasksystem(REF_correct);
        }
        else
        if (argSequenceType == SequenceType.sq_GameOver)
        {
            Setup_Tasksystem(Sequence_U_GameOver);
        }
        else

        if (argSequenceType == SequenceType.sq_wrong)
        {
            Setup_Tasksystem(REF_Wrong);
        }
        else
        {
            Setup_Tasksystem(Sequence_WrongFloor_Short);
        }



        CharacterItemManager cim = _Dweller.GetComponent <CharacterItemManager>();

        if (cim != null)
        {
            cim.Show_LR(false, GameEnums.AnimalCharacterHands.Left);
        }
        else
        {
            Debug.LogError("NO ItemMAnager ");
        }
    }
Beispiel #5
0
 /// <summary>
 /// Gets an action out of the table by action table and action name.
 /// </summary>
 /// <param name="sequenceType">Sequence the action belongs to.</param>
 /// <param name="actionId">Name of the action to find.</param>
 /// <value>Action matching description.</value>
 public Action this[SequenceType sequenceType, string actionId]
 {
     get { return((Action)this.actions[String.Concat(sequenceType.ToString(), actionId)]); }
 }
Beispiel #6
0
 /// <summary>
 /// Gets an action out of the table by action table and action name.
 /// </summary>
 /// <param name="sequenceType">Sequence the action belongs to.</param>
 /// <param name="actionId">Name of the action to find.</param>
 /// <value>Action matching description.</value>
 public Action this[SequenceType sequenceType, string actionId]
 {
     get { return (Action)this.actions[String.Concat(sequenceType.ToString(), actionId)]; }
 }
        /// <summary>
        ///     Generate the XML structure
        /// </summary>
        /// <returns></returns>
        protected XmlDocument GenerateXml()
        {
            CheckMandatoryData();

            var xml = new XmlDocument();

            xml.AppendChild(xml.CreateXmlDeclaration("1.0", Encoding.UTF8.BodyName, "yes"));
            var el = (XmlElement)xml.AppendChild(xml.CreateElement("Document"));

            el.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
            el.SetAttribute("xmlns", "urn:iso:std:iso:20022:tech:xsd:pain.008.001.02");
            el.NewElement("CstmrDrctDbtInitn");

            // Part 1: Group Header
            var grpHdr = XmlUtils.GetFirstElement(xml, "CstmrDrctDbtInitn").NewElement("GrpHdr");

            grpHdr.NewElement("MsgId", MessageIdentification);
            grpHdr.NewElement("CreDtTm", StringUtils.FormatDateTime(CreationDate));
            grpHdr.NewElement("NbOfTxs", numberOfTransactions);
            grpHdr.NewElement("CtrlSum", StringUtils.FormatAmount(headerControlSum));
            grpHdr.NewElement("InitgPty").NewElement("Nm", InitiatingPartyName);
            if (InitiatingPartyId != null)
            {
                grpHdr.NewElement("InitgPty").NewElement("Id", InitiatingPartyId);
            }

            // Part 2: Payment Information
            var pmtInf = XmlUtils.GetFirstElement(xml, "CstmrDrctDbtInitn").NewElement("PmtInf");

            pmtInf.NewElement("PmtInfId", PaymentInfoId ?? MessageIdentification);
            if (CategoryPurposeCode != null)
            {
                pmtInf.NewElement("CtgyPurp").NewElement("Cd", CategoryPurposeCode);
            }

            pmtInf.NewElement("PmtMtd", paymentMethod);
            pmtInf.NewElement("NbOfTxs", numberOfTransactions);
            pmtInf.NewElement("CtrlSum", StringUtils.FormatAmount(paymentControlSum));
            var PmtTpInf = pmtInf.NewElement("PmtTpInf");

            PmtTpInf.NewElement("SvcLvl").NewElement("Cd", "SEPA");
            if (LocalInstrumentCode != null)
            {
                PmtTpInf.NewElement("LclInstrm").NewElement("Cd", LocalInstrumentCode.ToString());
            }
            PmtTpInf.NewElement("SeqTp", SequenceType.ToString());

            pmtInf.NewElement("ReqdColltnDt", StringUtils.FormatDate(RequestedExecutionDate));
            pmtInf.NewElement("Cdtr").NewElement("Nm", Debtor.Name);

            var dbtrAcct = pmtInf.NewElement("CdtrAcct");

            dbtrAcct.NewElement("Id").NewElement("IBAN", Debtor.Iban);
            dbtrAcct.NewElement("Ccy", DebtorAccountCurrency);

            pmtInf.NewElement("CdtrAgt").NewElement("FinInstnId").NewElement("BIC", Debtor.Bic);
            pmtInf.NewElement("ChrgBr", "SLEV");

            var othr = pmtInf.NewElement("CdtrSchmeId").NewElement("Id")
                       .NewElement("PrvtId")
                       .NewElement("Othr");

            othr.NewElement("Id", PersonId);
            othr.NewElement("SchmeNm").NewElement("Prtry", "SEPA");
            // Part 3: Debit Transfer Transaction Information
            foreach (SepaDebitTransferTransaction transfer in transactions)
            {
                GenerateTransaction(pmtInf, transfer);
            }

            return(xml);
        }