public void AddItem(Custom.Item item)
 {
     Custom.Item itemToAdd = item;
     for(int i=0;i<items.Count;i++)
     {
         if(items[i].id == -1)
         {
             items [i] = itemToAdd;
             GameObject itemObj = Instantiate (inventoryItem);
             itemObj.GetComponent<ItemData> ().item = itemToAdd;
             itemObj.transform.SetParent (slots[i].transform);
             itemObj.transform.position = itemObj.transform.parent.position;
             itemObj.transform.localScale = new Vector2 (1, 1);
             itemObj.GetComponent<Image> ().sprite = itemToAdd.Sprite;
             itemObj.name = itemToAdd.name;
             itemObj.GetComponent<ItemData>().onClick += delegate(int p_int)
             {
                 //Debug.Log("CHamando método do inventoryManager: " + p_int);
                 idAtual = p_int;
                 Stats(idAtual);
             };
             break;
         }
     }
     DataManager.SaveItems (items);
     screenNavigationRef.Back ();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Prevents a default instance of the <see cref="Keypad" /> class from being created.
        /// </summary>
        private Keypad()
        {
            Log.Debug("Keypad is initializing");
            Chroma.Initialize();

            _custom = Custom.Create();
        }
Ejemplo n.º 3
0
        public void ClonedStructShouldBeIdentical()
        {
            var original = new Custom(Color.Red);
            var clone = original.Clone();

            Assert.That(clone, Is.EqualTo(original));
        }
Ejemplo n.º 4
0
        public void ShouldClearToBlack()
        {
            var grid = new Custom(Color.Pink);
            grid.Clear();

            Assert.That(grid, Is.EqualTo(Custom.Create()));
        }
Ejemplo n.º 5
0
 public void ShouldPass()
 {
     var customA = new Custom { Val = 1 };
     var customB = new Custom { Val = 1 };
     var comparer = new CustomComparer<Custom>();
     customA.ShouldBeGreaterThanOrEqualTo(customB, comparer);
 }
Ejemplo n.º 6
0
        public void CustomObjectScenarioShouldFail()
        {
            var customA = new Custom { Val = 1 };
            var customB = new Custom { Val = 2 };
            var comparer = new CustomComparer<Custom>();
            Verify.ShouldFail(() =>
            customA.ShouldBeGreaterThanOrEqualTo(customB, comparer, "Some additional context"),

            errorWithSource:
            @"customA
            should be greater than or equal to
            Shouldly.Tests.TestHelpers.Custom (000000)
            but was
            Shouldly.Tests.TestHelpers.Custom (000000)

            Additional Info:
            Some additional context",

            errorWithoutSource:
            @"Shouldly.Tests.TestHelpers.Custom (000000)
            should be greater than or equal to
            Shouldly.Tests.TestHelpers.Custom (000000)
            but was not

            Additional Info:
            Some additional context"
            );
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Prevents a default instance of the <see cref="Keypad" /> class from being created.
        /// </summary>
        private Keypad()
        {
            Log.Debug("Keypad is initializing");
            Chroma.Initialize();

            _custom = new Custom(Color.Black);
        }
Ejemplo n.º 8
0
		public void SendKeysTest1() {
			f = new Form();
			f.Activated +=new EventHandler(SendKeysTest1_activated);
			c = new Custom();
			f.Controls.Add(c);
			Application.Run(f);
			c.Dispose();
		}
Ejemplo n.º 9
0
        public void ClonedStructShouldBeIndependent()
        {
            var original = new Custom(Color.Red);
            var clone = original.Clone();

            clone.Set(Color.Blue);

            Assert.That(clone, Is.Not.EqualTo(original));
        }
Ejemplo n.º 10
0
	void Start()
	{
		c = this;
		l = new LuaSvr();
		l.init(null, () =>
		{
			l.start("custom");
		});
	}
Ejemplo n.º 11
0
        public void ShouldEqualIdenticalGrid()
        {
            var a = new Custom(Color.Red, 42);
            var b = new Custom(Color.Red, 42);

            Assert.True(a == b);
            Assert.False(a != b);
            Assert.True(a.Equals(b));
            Assert.AreEqual(a, b);
        }
Ejemplo n.º 12
0
        public void ShouldConstructFromList()
        {
            var colors = new Color[Constants.MaxLeds];
            colors[0] = Color.Red;
            colors[1] = Color.Blue;
            colors[2] = Color.Green;

            var effect = new Custom(colors);

            for (var i = 0; i < Constants.MaxLeds; i++)
                Assert.AreEqual(colors[i], effect[i]);
        }
Ejemplo n.º 13
0
        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "txt files(*.txt)|*.txt";
            //string path = openFileDialog1.FileName;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                reader = new System.IO.StreamReader(openFileDialog1.FileName, Encoding.Default);
                while(!reader.EndOfStream)
                {
                    string line = reader.ReadLine() + "\n";
                    string[] S = line.Split(':');
                    Custom Cus = new Custom();
                    Cus.AccountName = S[0];
                    Cus.AccountBalance = double.Parse(S[1]);
                    Cus.AccountNumber = S[3];
                    Cus.AccountType = S[2];
                    list.Add(Cus);

                }
                reader.Close();

            }
        }
Ejemplo n.º 14
0
    protected Int32 Send_Email_Database_Insert()
    {
        var sp_emailid = 0;
        var doinsert   = false;
        var doexists   = false;
        var doerror    = false;
        var msgLog     = "";

        #region SQL Connection
        using (SqlConnection con = new SqlConnection(Custom.connStr))
        {
            Custom.Database_Open(con);
            #region SQL Command
            using (SqlCommand cmd = new SqlCommand("", con))
            {
                #region Build cmdText
                String cmdText = "";
                cmdText = @"
INSERT INTO [dbo].[application_agent_email]
	([status]
    ,[businessname]
	,[businessphone]
	,[businessemail]
	,[firstname]
	,[middlename]
	,[lastname]
	,[callcenter]
	,[agentfirstname]
	,[agentlastname]
	,[agentid]
	,[ani]
	,[dnis]
	,[callid]
	,[calltime]
	,[datecreated])
SELECT
    @sp_status
    ,@sp_businessname
    ,@sp_businessphone
    ,@sp_businessemail
    ,@sp_firstname
    ,@sp_middlename
    ,@sp_lastname
    ,@sp_callcenter
    ,@sp_agentfirstname
    ,@sp_agentlastname
    ,@sp_agentid
    ,@sp_ani
    ,@sp_dnis
    ,@sp_callid
    ,@sp_calltime
    ,GETUTCDATE()

SELECT SCOPE_IDENTITY()
                ";
                #endregion Build cmdText
                #region SQL Parameters

                var sp_businessname   = (tbBusinessName.Text.Length > 0) ? tbBusinessName.Text : null;
                var sp_businessphone  = (tbBusinessPhone.Text.Length > 0) ? tbBusinessPhone.Text : null;
                var sp_businessemail  = (tbBusinessEmail.Text.Length > 0) ? tbBusinessEmail.Text : null;
                var sp_firstname      = (tbFirstName.Text.Length > 0) ? tbFirstName.Text : null;
                var sp_middlename     = (tbMiddleName.Text.Length > 0) ? tbMiddleName.Text : null;
                var sp_lastname       = (tbLastName.Text.Length > 0) ? tbLastName.Text : null;
                var sp_callcenter     = (ddlCallCenter.Text.Length > 0) ? ddlCallCenter.Text : null;
                var sp_agentfirstname = (tbAgentFirstName.Text.Length > 0) ? tbAgentFirstName.Text : null;
                var sp_agentlastname  = (tbAgentLastName.Text.Length > 0) ? tbAgentLastName.Text : null;
                var sp_agentid        = (ddlAgentID.SelectedValue != null) ? ddlAgentID.SelectedValue : null;

                var sp_callani  = (hfANI.Value.Length > 0) ? hfANI.Value : null;
                var sp_calldnis = (hfDNIS.Value.Length > 0) ? hfDNIS.Value : null;
                var sp_callid   = (hfCallID.Value.Length > 0) ? hfCallID.Value : null;
                var sp_calltime = (hfCallTime.Value.Length > 0) ? hfCallTime.Value : null;


                cmd.CommandText = cmdText;
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Clear();
                cmd.Parameters.Add("@sp_status", SqlDbType.Int).Value = 10002010;
                cmd.Parameters.Add("@sp_businessname", SqlDbType.VarChar, 100).Value   = (object)sp_businessname ?? DBNull.Value;
                cmd.Parameters.Add("@sp_businessphone", SqlDbType.VarChar, 100).Value  = (object)sp_businessphone ?? DBNull.Value;
                cmd.Parameters.Add("@sp_businessemail", SqlDbType.VarChar, 100).Value  = (object)sp_businessemail ?? DBNull.Value;
                cmd.Parameters.Add("@sp_firstname", SqlDbType.VarChar, 100).Value      = (object)sp_firstname ?? DBNull.Value;
                cmd.Parameters.Add("@sp_middlename", SqlDbType.VarChar, 100).Value     = (object)sp_middlename ?? DBNull.Value;
                cmd.Parameters.Add("@sp_lastname", SqlDbType.VarChar, 100).Value       = (object)sp_lastname ?? DBNull.Value;
                cmd.Parameters.Add("@sp_callcenter", SqlDbType.VarChar, 100).Value     = (object)sp_callcenter ?? DBNull.Value;
                cmd.Parameters.Add("@sp_agentfirstname", SqlDbType.VarChar, 100).Value = (object)sp_agentfirstname ?? DBNull.Value;
                cmd.Parameters.Add("@sp_agentlastname", SqlDbType.VarChar, 100).Value  = (object)sp_agentlastname ?? DBNull.Value;
                cmd.Parameters.Add("@sp_agentid", SqlDbType.VarChar, 100).Value        = (object)sp_agentid ?? DBNull.Value;
                cmd.Parameters.Add("@sp_ani", SqlDbType.VarChar, 100).Value            = (object)sp_callani ?? DBNull.Value;
                cmd.Parameters.Add("@sp_dnis", SqlDbType.VarChar, 100).Value           = (object)sp_calldnis ?? DBNull.Value;
                cmd.Parameters.Add("@sp_callid", SqlDbType.VarChar, 100).Value         = (object)sp_callid ?? DBNull.Value;
                cmd.Parameters.Add("@sp_calltime", SqlDbType.DateTime).Value           = (object)sp_calltime ?? DBNull.Value;
                cmd.Parameters.Add("@sp_host", SqlDbType.VarChar, 250).Value           = Request.Url.Host;
                cmd.Parameters.Add("@sp_url", SqlDbType.VarChar, 250).Value            = Request.Url.AbsoluteUri;
                #endregion SQL Parameters
                // print_sql(cmd, "append"); // Will print for Admin in Local
                #region SQL Command Processing
                var chckResults = cmd.ExecuteScalar();
                if (chckResults != null && chckResults.ToString() != "0")
                {
                    // We inserted the ticket
                    sp_emailid = Convert.ToInt32(chckResults.ToString());
                    // Don't show this message, it is only relevant if something went wrong
                    //msgLog += String.Format("<li>{0}: {1}</li>", "Application Created.", sp_applicationid);
                    doinsert = true;
                }
                else
                {
                    // There was a problem inserting the ticket
                    sp_emailid = -1;
                    doerror    = true;
                    msgLog    += String.Format("<li>{0}</li>", "Failed to get a Email ID.");

                    lblProcessMessage.Text = msgLog;
                }
                #endregion SQL Command Processing
            }
            #endregion SQL Command
        }
        #endregion SQL Connection

        return(sp_emailid);
    }
Ejemplo n.º 15
0
 public void FillInventory(Custom.Item item)
 {
     Custom.Item itemToAdd = item;
     for(int i=0;i<items.Count;i++)
     {
         if(items[i].id == -1)
         {
             items [i] = itemToAdd;
             GameObject itemObj = Instantiate (inventoryItem);
             itemObj.GetComponent<ItemData> ().item = itemToAdd;
             itemObj.transform.SetParent (slots[i].transform);
             itemObj.transform.position = itemObj.transform.parent.position;
             itemObj.transform.localScale = new Vector2 (1, 1);
             itemObj.GetComponent<Image> ().sprite = itemToAdd.Sprite;
             itemObj.name = itemToAdd.name;
             itemObj.GetComponent<ItemData>().onClick += delegate(int p_int)
             {
                 idAtual = p_int;
                 Stats(idAtual);
             };
             break;
         }
     }
 }
Ejemplo n.º 16
0
 public override Custom<Custom<int>> opCustomIntSS(Custom<Custom<int>> i, out Custom<Custom<int>> o,
                                                   Ice.Current current)
 {
     o = i;
     return i;
 }
Ejemplo n.º 17
0
    protected void Get_DDL_CallCenters(DropDownList ddl)
    {
        /// Get the users Applications and display them
        /// Allow the user to select which application they will work on
        /// Create the new application, allow the user to click to navigate to Part 1
        ///
        bool   getApp = true;
        bool   hasApp = false;
        String msgLog = "";

        if (getApp)
        {
            userid = User.Identity.GetUserId <int>();
            // tbEmailAddress.Text
            #region SQL Connection
            using (SqlConnection con = new SqlConnection(Custom.connStr))
            {
                Custom.Database_Open(con);
                #region SQL Command
                using (SqlCommand cmd = new SqlCommand("", con))
                {
                    #region Build cmdText
                    String cmdText = "";
                    cmdText = @"
SELECT
'' [value]
,'Active Centers' [name]
UNION ALL
SELECT
[acc].[centerid] [value]
,[acc].[centerid] [name]
FROM [dbo].[application_call_center] [acc] WITH(NOLOCK)
WHERE 1=1
AND [acc].[status] = 10500010
                            ";
                    if (HttpContext.Current.User.IsInRole("Call Center Managers"))
                    {
                        cmdText += @"
-- Call Center Managers
AND [acc].[centerid] = (
SELECT
[acc].[centerid]
FROM [dbo].[application_call_center_user] [accu] WITH(NOLOCK)
JOIN [dbo].[application_call_center] [acc] WITH(NOLOCK) ON [acc].[id] = [accu].[callcenterid]
WHERE [accu].[userid] = @sp_userid
)
";
                    }
                    cmdText += "\r";
                    #endregion Build cmdText
                    #region SQL Command Config
                    cmd.CommandTimeout = 600;
                    cmd.CommandText    = cmdText;
                    cmd.CommandType    = CommandType.Text;
                    cmd.Parameters.Clear();
                    #endregion SQL Command Config
                    #region SQL Command Parameters
                    cmd.Parameters.Add("@sp_userid", SqlDbType.Int).Value = userid;
                    #endregion SQL Command Parameters
                    // print_sql(cmd, "append"); // Will print for Admin in Local
                    #region SQL Command Processing
                    SqlDataAdapter ad = new SqlDataAdapter(cmd);
                    DataTable      dt = new DataTable();
                    ad.Fill(dt);
                    ddl.DataSource     = dt;
                    ddl.DataValueField = "value";
                    ddl.DataTextField  = "name";
                    ddl.DataBind();
                    if (ddl.Items.Count > 0)
                    {
                    }
                    #endregion SQL Command Processing
                }
                #endregion SQL Command
            }
            #endregion SQL Connection
        }
        else
        {
            msgLog = "<br />Unable to create application";
        }

        if (msgLog.Length > 0)
        {
            lblProcessMessage.Text += "<br />" + msgLog;
        }
        //if (success)
        //Response.Redirect("~/Application/Page01.aspx");
    }
Ejemplo n.º 18
0
 /// <summary>
 /// Sets a custom effect on the mouse.
 /// </summary>
 /// <param name="effect">An instance of the <see cref="Custom" /> struct.</param>
 public void SetCustom(Custom effect)
 {
     SetGuid(NativeWrapper.CreateMouseEffect(effect));
 }
Ejemplo n.º 19
0
    } //TestPointer::Copy(...)

    public void Read(BinaryReader r)
    {
        sbyte selfExists = r.ReadSByte();
        if ((sbyte)0x01 == selfExists) {
            if (this.self == null) { this.self = new TestPointer(); }
            this.self.Read(r);
        }
        else if ((sbyte)0x00 == selfExists) { this.self = null; }
        else { throw new IOException("Protoc read error: The value of 'selfExists' is invalid.", 497); }
        sbyte stringValueExists = r.ReadSByte();
        if ((sbyte)0x01 == stringValueExists) {
            this.stringValue = Encoding.UTF8.GetString(r.ReadBytes(r.ReadInt32()));
        }
        else if ((sbyte)0x00 == stringValueExists) { this.stringValue = null; }
        else { throw new IOException("Protoc read error: The value of 'stringValueExists' is invalid.", 496); }
        sbyte otherExists = r.ReadSByte();
        if ((sbyte)0x01 == otherExists) {
            if (this.other == null) { this.other = new Custom(); }
            this.other.Read(r);
        }
        else if ((sbyte)0x00 == otherExists) { this.other = null; }
        else { throw new IOException("Protoc read error: The value of 'otherExists' is invalid.", 497); }
        sbyte listI08Exists = r.ReadSByte();
        if ((sbyte)0x01 == listI08Exists) {
            if (this.listI08 == null) { this.listI08 = new List<SByte>(); }
            UInt32 lenListI08 = r.ReadUInt32();
            for (UInt32 iListI08 = 0; iListI08 < lenListI08; iListI08++) {
                SByte n1 = r.ReadSByte();
                this.listI08.Add(n1);
            }
        }
        else if ((sbyte)0x00 == listI08Exists) { this.listI08 = null; }
        else { throw new IOException("Protoc read error: The value of 'listI08Exists' is invalid.", 498); }
        sbyte dictI08Exists = r.ReadSByte();
        if ((sbyte)0x01 == dictI08Exists) {
            if (this.dictI08 == null) { this.dictI08 = new Dictionary<SByte,SByte>(); }
            UInt32 lenDictI08 = r.ReadUInt32();
            for (UInt32 iDictI08 = 0; iDictI08 < lenDictI08; iDictI08++) {
                SByte k1 = r.ReadSByte();
                SByte v1 = r.ReadSByte();
                if (!this.dictI08.ContainsKey(k1)) {
                    this.dictI08.Add(k1, v1);
                } else {
                    this.dictI08[k1] = v1;
                }
            }
        }
        else if ((sbyte)0x00 == dictI08Exists) { this.dictI08 = null; }
        else { throw new IOException("Protoc read error: The value of 'dictI08Exists' is invalid.", 498); }
        sbyte listNestedExists = r.ReadSByte();
        if ((sbyte)0x01 == listNestedExists) {
            if (this.listNested == null) { this.listNested = new List<List<List<List<TestPointer>>>>(); }
            UInt32 lenListNested = r.ReadUInt32();
            for (UInt32 iListNested = 0; iListNested < lenListNested; iListNested++) {
                List<List<List<TestPointer>>> n1 = new List<List<List<TestPointer>>>(); //read.vec.head
                UInt32 lenN1 = r.ReadUInt32();
                for (UInt32 iN1 = 0; iN1 < lenN1; iN1++) {
                    List<List<TestPointer>> n2 = new List<List<TestPointer>>(); //read.vec.head
                    UInt32 lenN2 = r.ReadUInt32();
                    for (UInt32 iN2 = 0; iN2 < lenN2; iN2++) {
                        List<TestPointer> n3 = new List<TestPointer>(); //read.vec.head
                        UInt32 lenN3 = r.ReadUInt32();
                        for (UInt32 iN3 = 0; iN3 < lenN3; iN3++) {
                            TestPointer n4 = new TestPointer();
                            n4.Read(r);
                            n3.Add(n4);
                        }
                        n2.Add(n3);
                    }
                    n1.Add(n2);
                }
                this.listNested.Add(n1);
            }
        }
        else if ((sbyte)0x00 == listNestedExists) { this.listNested = null; }
        else { throw new IOException("Protoc read error: The value of 'listNestedExists' is invalid.", 498); }
        this.numberSingle = r.ReadSingle();
        this.enumValue = (Gender)Enum.ToObject(typeof(Gender), r.ReadInt32());
        sbyte hotfixExists = r.ReadSByte();
        if ((sbyte)0x01 == hotfixExists) {
            if (this.hotfix == null) { this.hotfix = new Dictionary<String,String>(); }
            UInt32 lenHotfix = r.ReadUInt32();
            for (UInt32 iHotfix = 0; iHotfix < lenHotfix; iHotfix++) {
                String k1 = Encoding.UTF8.GetString(r.ReadBytes(r.ReadInt32()));
                String v1 = Encoding.UTF8.GetString(r.ReadBytes(r.ReadInt32()));
                if (!this.hotfix.ContainsKey(k1)) {
                    this.hotfix.Add(k1, v1);
                } else {
                    this.hotfix[k1] = v1;
                }
            }
        }
        else if ((sbyte)0x00 == hotfixExists) { this.hotfix = null; }
        else { throw new IOException("Protoc read error: The value of 'hotfixExists' is invalid.", 498); }
    } //TestPointer::Read(...)
Ejemplo n.º 20
0
 opCustomIntSAsync(Custom <int> i, Current current)
 {
     return(Task.FromResult(new Test.MyClass.OpCustomIntSReturnValue(i, i)));
 }
Ejemplo n.º 21
0
 opCustomCVSSAsync(Custom <Custom <Test.CV> > i, Current current)
 {
     return(Task.FromResult(new Test.MyClass.OpCustomCVSSReturnValue(i, i)));
 }
Ejemplo n.º 22
0
 public override Custom <Custom <int> > opCustomIntSS(Custom <Custom <int> > i, out Custom <Custom <int> > o,
                                                      Ice.Current current)
 {
     o = i;
     return(i);
 }
Ejemplo n.º 23
0
 public override Custom <Custom <CV> > opCustomCVSS(Custom <Custom <CV> > i, out Custom <Custom <CV> > o,
                                                    Ice.Current current)
 {
     o = i;
     return(i);
 }
Ejemplo n.º 24
0
 private SettingsProvider()
 {
     Custom.Initialize();
     loadConfigs("configData.xml");
 }
Ejemplo n.º 25
0
    protected void Get_HistoryLog()
    {
        /// Get the users Applications and display them
        /// Allow the user to select which application they will work on
        /// Create the new application, allow the user to click to navigate to Part 1
        ///
        bool   getApp = true;
        bool   hasApp = false;
        String msgLog = "";

        if (getApp)
        {
            GridView gvEmails  = (GridView)lgUserLoggedIn.FindControl("gvEmails");
            GridView gv        = gvEmails;
            var      sp_userid = User.Identity.GetUserId <int>();

            #region SQL Connection
            using (SqlConnection con = new SqlConnection(Custom.connStr))
            {
                Custom.Database_Open(con);
                #region SQL Command
                using (SqlCommand cmd = new SqlCommand("", con))
                {
                    #region Build cmdText
                    String cmdText = "";
                    cmdText  = @"
SELECT
TOP (@sp_top)
[hl].[id]
,[hl].[actionid]
,[u].[username]
,[u].[firstname]
,[u].[lastname]
,[hl].[targetid]
,[hl].[groupid]
,[hl].[datecreated]
,[hl].[actorid]
,CASE
	-- Call Centers
	WHEN [hl].[groupid] = 10300040 THEN (SELECT [acc].[name] FROM [dbo].[application_call_center] [acc] WITH(NOLOCK) WHERE [acc].[id] = [hl].[targetid])
	ELSE ''
END [towhat]
FROM [dbo].[historylog] [hl] WITH(NOLOCK)
LEFT OUTER JOIN [dbo].[AspNetUsers] [u] WITH(NOLOCK) ON [u].[id] = [hl].[actorid]
ORDER BY [id] DESC
                            ";
                    cmdText += "\r";
                    #endregion Build cmdText
                    #region SQL Command Config
                    cmd.CommandTimeout = 600;
                    cmd.CommandText    = cmdText;
                    cmd.CommandType    = CommandType.Text;
                    cmd.Parameters.Clear();
                    #endregion SQL Command Config
                    #region SQL Command Parameters
                    cmd.Parameters.Add("@sp_userid", SqlDbType.Int).Value = sp_userid;
                    cmd.Parameters.Add("@sp_top", SqlDbType.Int).Value    = 50;
                    #endregion SQL Command Parameters
                    // print_sql(cmd, "append"); // Will print for Admin in Local
                    #region SQL Command Processing
                    SqlDataAdapter ad = new SqlDataAdapter(cmd);
                    DataTable      dt = new DataTable();
                    ad.Fill(dt);
                    ViewState["dtGridView"] = dt; // Used for Paging and Sorting
                    gv.DataSource           = dt;
                    gv.DataBind();
                    if (gv.Rows.Count > 0)
                    {
                        gv.HeaderRow.TableSection = TableRowSection.TableHeader;
                    }
                    if (dt.Rows.Count > 0)
                    {
                        hasApp = true;
                    }
                    #endregion SQL Command Processing
                }
                #endregion SQL Command
                if (hasApp)
                {
                    /// The user has Applications
                    /// Display the application grid and the 'Add *New* Application' button
                    /// Hide the 'Create Application' button
                    ///
                    hasEmails.Visible = true;
                }
                else
                {
                    /// The user has no Applications
                    /// Hide the Grid panel and show the Create Application Panel
                    hasEmails.Visible = false;
                }
            }
            #endregion SQL Connection
        }
        else
        {
            msgLog = "<br />Unable to create application";
        }

        Label lblProcessMessage = (Label)lgUserLoggedIn.FindControl("lblProcessMessage");
        if (lblProcessMessage != null)
        {
            lblProcessMessage.Text += "<br />" + msgLog;
        }
        //if (success)
        //Response.Redirect("~/Application/Page01.aspx");
    }
Ejemplo n.º 26
0
    protected void Send_Email_Click()
    {
        lblProcessMessage.Text = "";
        var errMsg = "";

        try
        {
            // Request.Url.Host
            #region Process Send Email Click
            bool passValidation = false;
            bool emailSuccess   = false;
            var  sp_emailid     = 0;

            // We need .Net validation for backend-code
            if (tbBusinessEmail.Text.Length > 0 && tbBusinessName.Text.Length > 0 && tbBusinessPhone.Text.Length > 0)
            {
                passValidation = true;
                // validate the email address against the unsubscribe
                if (Custom.validateEmail_Unsubscribed(tbBusinessEmail.Text))
                {
                    passValidation = false;
                    errMsg        += String.Format("<li>{0}: {1} </li>", DateTime.Now.ToString("HH:mm:ss"), "Fatal Error - Not Recoverable");
                    errMsg        += String.Format("<li>{0}: {1} </li>", DateTime.Now.ToString("HH:mm:ss"), "Email address is part of Do Not Email list.");
                }
            }

            if (!passValidation)
            {
                lblProcessMessage.Text = "Validation failed...";
                if (errMsg.Length > 0)
                {
                    lblProcessMessage.Text += errMsg;
                }
            }
            else
            {
                sp_emailid = Send_Email_Database_Insert();
            }
            // Send the email if passed the validation
            if (sp_emailid > 0 && Send_Email_Client(sp_emailid))
            {
                // Send the internal email
                bool internalEmail = Send_Email_Internal();

                emailSuccess      = true;
                sendEmail.Visible = false;
                emailSent.Visible = true;

                var htmlMessage = submittedMessage.InnerHtml;

                var      agentName   = (tbAgentFirstName.Text + " " + tbAgentLastName.Text).Trim();
                DateTime EpochStart  = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                DateTime Date        = DateTime.UtcNow;
                TimeSpan elapsedTime = Date - EpochStart;
                var      epoch       = (long)elapsedTime.TotalSeconds;

                //var confirmationNumber = "CG" + epoch.ToString();
                var confirmationNumber = "CG" + sp_emailid.ToString();
                var businessName       = tbBusinessName.Text;
                var businessEmail      = tbBusinessEmail.Text;
                var accountOwner       = "Card Groupt Intl";

                // Show the success page
                htmlMessage = htmlMessage.Replace("{agent}", agentName);
                htmlMessage = htmlMessage.Replace("{confirmation}", confirmationNumber);
                htmlMessage = htmlMessage.Replace("{businessname}", businessName);
                htmlMessage = htmlMessage.Replace("{businessemail}", businessEmail);
                htmlMessage = htmlMessage.Replace("{accountholder}", accountOwner);

                submittedMessage.InnerHtml = htmlMessage;
            }
            if (passValidation)
            {
                // Now log the record in the DB
                // Log the attempt in the DB, we do this if we pass validation regardless if the email was sent successfully.
                // If the email failed for some reason, we need to log that in the DB as well.
            }
            #endregion Process Send Email Click
        }
        catch (Exception ex)
        {
            lblProcessMessage.Text = "Error sending email";

            lblProcessMessage.Text += String.Format("<table class='table_error'>"
                                                    + "<tr><td>Error<td/><td>{0}</td></tr>"
                                                    + "<tr><td>Message<td/><td>{1}</td></tr>"
                                                    + "<tr><td>StackTrace<td/><td>{2}</td></tr>"
                                                    + "<tr><td>Source<td/><td>{3}</td></tr>"
                                                    + "<tr><td>InnerException<td/><td>{4}</td></tr>"
                                                    + "<tr><td>Data<td/><td>{5}</td></tr>"
                                                    + "</table>"
                                                    , "Email Sender"    //0
                                                    , ex.Message        //1
                                                    , ex.StackTrace     //2
                                                    , ex.Source         //3
                                                    , ex.InnerException //4
                                                    , ex.Data           //5
                                                    , ex.HelpLink
                                                    , ex.TargetSite
                                                    );
        }
    }
Ejemplo n.º 27
0
 public override void ice_response(Custom<Custom<int>> r, Custom<Custom<int>> o)
 {
     test(Ice.CollectionComparer.Equals(_i, o));
     test(Ice.CollectionComparer.Equals(_i, r));
     callback.called();
 }
    public override void Update()
    {
        base.Update();
        if (this.culled)
        {
            return;
        }
        for (int i = 0; i < this.danglers.Length; i++)
        {
            this.danglers[i].Update();
        }
        if (this.fish.Consious)
        {
            this.swim -= Custom.LerpMap(this.fish.swimSpeed, 1.6f, 5f, 0.0333333351f, 0.06666667f);
        }
        this.tail[0].connectedPoint     = new Vector2?(this.fish.bodyChunks[1].pos);
        this.wings[0, 0].connectedPoint = new Vector2?(this.fish.bodyChunks[0].pos);
        this.wings[1, 0].connectedPoint = new Vector2?(this.fish.bodyChunks[0].pos);
        Vector2 vector = Custom.DirVec(this.fish.bodyChunks[1].pos, this.fish.bodyChunks[0].pos);
        Vector2 a      = Custom.PerpendicularVector(vector);

        this.lastZRotation = this.zRotation;
        if (Mathf.Abs(vector.x) > 0.5f && this.fish.Consious)
        {
            this.zRotation = Vector2.Lerp(this.zRotation, new Vector2((vector.x <= 0f) ? 1f : -1f, 0f), 0.2f);
        }
        else
        {
            this.zRotation = Vector2.Lerp(this.zRotation, -vector, 0.5f);
        }
        this.zRotation = this.zRotation.normalized;
        if (this.fish.Consious)
        {
            float num = 1f - this.fish.bodyChunks[1].submersion;
            if (this.airEyes < num)
            {
                this.airEyes = Mathf.Min(this.airEyes + 0.1f, num);
            }
            else
            {
                this.airEyes = Mathf.Max(this.airEyes - 0.0333333351f, num);
            }
        }
        for (int i = 0; i < 2; i++)
        {
            this.flippers[i].Update();
            this.flippers[i].ConnectToPoint(this.fish.bodyChunks[1].pos, (this.flipperGraphWidth + 7f) * this.fish.iVars.flipperSize, false, 0f, this.fish.bodyChunks[1].vel, 0.3f, 0f);
            Vector2 vector2 = a * this.zRotation.y * ((i != 0) ? 1f : -1f);
            vector2 += new Vector2(0f, -0.5f) * Mathf.Abs(this.zRotation.x);
            vector2 += vector * this.fish.iVars.flipperOrientation * 1.5f;
            if (this.fish.Consious)
            {
                if (i == 0 == this.zRotation.x < 0f)
                {
                    vector2 += vector * Mathf.Sin(this.swim * 3.14159274f * 2f) * 0.3f * (1f - this.fish.jetActive);
                }
                else
                {
                    vector2 += vector * Mathf.Cos(this.swim * 3.14159274f * 2f) * 0.3f * (1f - this.fish.jetActive);
                }
                vector2 = Vector2.Lerp(vector2, -vector, this.fish.jetActive * this.fish.jetWater);
            }
            this.flippers[i].vel += (this.fish.bodyChunks[1].pos + vector2 * (this.flipperGraphWidth + 7f) * this.fish.iVars.flipperSize - this.flippers[i].pos) / ((!this.fish.Consious) ? 16f : 8f);
            if (this.fish.room.PointSubmerged(this.flippers[i].pos))
            {
                this.flippers[i].vel *= 0.9f;
            }
            else
            {
                GenericBodyPart genericBodyPart = this.flippers[i];
                genericBodyPart.vel.y = genericBodyPart.vel.y - 0.6f;
            }
            if (this.fish.iVars.whiskers > 0)
            {
                for (int j = 0; j < this.fish.iVars.whiskers; j++)
                {
                    this.whiskers[i, j].vel += this.whiskerDir(i, j, this.zRotation, vector) * this.whiskerProps[j, 2];
                    if (this.fish.room.PointSubmerged(this.whiskers[i, j].pos))
                    {
                        this.whiskers[i, j].vel *= 0.8f;
                    }
                    else
                    {
                        GenericBodyPart genericBodyPart2 = this.whiskers[i, j];
                        genericBodyPart2.vel.y = genericBodyPart2.vel.y - 0.6f;
                    }
                    this.whiskers[i, j].Update();
                    this.whiskers[i, j].ConnectToPoint(this.fish.bodyChunks[2].pos - vector * 5f + this.whiskerDir(i, j, this.zRotation, vector) * 5f, this.whiskerProps[j, 0], false, 0f, this.fish.bodyChunks[2].vel, 0f, 0f);
                }
            }

            for (int x = 0; x < 2; x++)
            {
                for (int k = 0; k < this.wings.GetLength(1); k++)
                {
                    Vector2 look = Custom.PerpendicularVector(Custom.DirVec(this.fish.bodyChunks[1].pos, this.fish.bodyChunks[0].pos));
                    if (x == 0)
                    {
                        look = -look;
                    }
                    float push = Custom.AimFromOneVectorToAnother(this.fish.bodyChunks[0].pos + look, this.fish.bodyChunks[0].pos);
                    this.wings[x, k].Update();
                    float num2 = Mathf.InverseLerp(0f, (float)(this.wings.GetLength(1) - 1), (float)k);
                    if (!Custom.DistLess(this.wings[x, k].pos, this.fish.bodyChunks[1].pos, 15f * (float)(k + 1)))
                    {
                        this.wings[x, k].pos = this.fish.bodyChunks[1].pos + Custom.DirVec(this.fish.bodyChunks[1].pos, this.wings[x, k].pos) * 15f * (float)(k + 1);
                    }
                    float num3 = this.fish.jetActive;
                    if (this.fish.room.PointSubmerged(this.wings[x, k].pos))
                    {
                        this.wings[x, k].vel *= 0.7f;
                        num3 = Mathf.Lerp(num3, 0f, 0.5f);
                    }
                    else
                    {
                        TailSegment wingSegment = this.wings[x, k];
                        wingSegment.vel.y = wingSegment.vel.y - 0.9f * Mathf.Pow((float)k / (float)(this.wings.GetLength(1) - 1), 3f);
                    }
                    this.wings[x, k].vel += a * Mathf.Sin((this.swim + (float)k / 5f) * 3.14159274f * 2f) * ((i != 0) ? -1f : 1f) * Mathf.Pow(1f - num2, 2f) * Custom.LerpMap(this.fish.swimSpeed, 1.6f, 5f, 8f, 16f) * (1f - num3);
                    this.wings[x, k].vel -= look * (0.2f * (1f - num3) + Mathf.Pow(Mathf.InverseLerp(0.5f, 0f, num2), 2f) * Mathf.Lerp(27f, 11f, num3));
                    float num4 = 30f + Mathf.Sin(Mathf.Pow(num2, 1f) * 3.14159274f * -2f) * -100f;
                    this.wings[x, k].vel          -= Custom.DegToVec(push + num4 * ((i != 0) ? -1f : 1f)) * Mathf.Lerp(12f, 6f, num2) * num3;
                    this.wings[x, k].connectionRad = Mathf.Lerp(10f, 0.5f, Mathf.Lerp(0f, num3, Mathf.Pow(num2, 0.2f))) * Mathf.Lerp(0.5f, 1.5f, this.fish.iVars.tentacleLength);
                    this.wings[x, k].rad           = Mathf.Lerp(this.TentacleContour(num2, k), Mathf.Lerp(8f, 2f, num2) * (0.5f + 0.5f * this.fish.jetWater), num3) * Mathf.Lerp(0.7f, 1.2f, this.fish.iVars.tentacleFatness);
                }
            }
            for (int k = 0; k < this.tail.Length; k++)
            {
                this.tail[k].Update();
                float num2 = Mathf.InverseLerp(0f, (float)(this.tail.Length - 1), (float)k);
                if (!Custom.DistLess(this.tail[k].pos, this.fish.bodyChunks[1].pos, 15f * (float)(k + 1)))
                {
                    this.tail[k].pos = this.fish.bodyChunks[1].pos + Custom.DirVec(this.fish.bodyChunks[1].pos, this.tail[k].pos) * 15f * (float)(k + 1);
                }
                float num3 = this.fish.jetActive;
                if (this.fish.room.PointSubmerged(this.tail[k].pos))
                {
                    this.tail[k].vel *= 0.7f;
                    num3              = Mathf.Lerp(num3, 0f, 0.5f);
                }
                else
                {
                    TailSegment tailSegment = this.tail[k];
                    tailSegment.vel.y = tailSegment.vel.y - 0.9f * Mathf.Pow((float)k / (float)(this.tail.Length - 1), 3f);
                }
                this.tail[k].vel += a * Mathf.Sin((this.swim + (float)k / 5f) * 3.14159274f * 2f) * ((i != 0) ? -1f : 1f) * Mathf.Pow(1f - num2, 2f) * Custom.LerpMap(this.fish.swimSpeed, 1.6f, 5f, 8f, 16f) * (1f - num3);
                this.tail[k].vel -= vector * (0.2f * (1f - num3) + Mathf.Pow(Mathf.InverseLerp(0.5f, 0f, num2), 2f) * Mathf.Lerp(27f, 11f, num3));
                float num4 = 30f + Mathf.Sin(Mathf.Pow(num2, 1f) * 3.14159274f * -2f) * -100f;
                this.tail[k].vel          -= Custom.DegToVec(Custom.AimFromOneVectorToAnother(this.fish.bodyChunks[1].pos, this.fish.bodyChunks[0].pos) + num4 * ((i != 0) ? -1f : 1f)) * Mathf.Lerp(12f, 6f, num2) * num3;
                this.tail[k].connectionRad = Mathf.Lerp(10f, 0.5f, Mathf.Lerp(0f, num3, Mathf.Pow(num2, 0.2f))) * Mathf.Lerp(0.5f, 1.5f, this.fish.iVars.tentacleLength);
                this.tail[k].rad           = Mathf.Lerp(this.TentacleContour(num2, k), Mathf.Lerp(8f, 2f, num2) * (0.5f + 0.5f * this.fish.jetWater), num3) * Mathf.Lerp(0.7f, 1.2f, this.fish.iVars.tentacleFatness);
            }
        }
    }
Ejemplo n.º 29
0
 public override void ice_response(Custom<Custom<CV>> r, Custom<Custom<CV>> o)
 {
     IEnumerator<Custom<CV>> eo = (IEnumerator<Custom<CV>>)o.GetEnumerator();
     IEnumerator<Custom<CV>> er = (IEnumerator<Custom<CV>>)r.GetEnumerator();
     foreach(Custom<CV> s in _i)
     {
         eo.MoveNext();
         er.MoveNext();
         IEnumerator<CV> io = (IEnumerator<CV>)eo.Current.GetEnumerator();
         IEnumerator<CV> ir = (IEnumerator<CV>)er.Current.GetEnumerator();
         foreach(CV obj in s)
         {
             io.MoveNext();
             ir.MoveNext();
             if(obj == null)
             {
                 test(io.Current == null);
                 test(ir.Current == null);
             }
             else
             {
                 test(obj.i == io.Current.i);
                 test(obj.i == ir.Current.i);
             }
         }
     }
     callback.called();
 }
Ejemplo n.º 30
0
 void Start()
 {
     c = this;
     l = new LuaSvr();
     l.start("custom");
 }
Ejemplo n.º 31
0
        public void ShouldGetWithKeyIndexer()
        {
            var grid = new Custom(Color.red);

            Assert.AreEqual(Color.red, grid[Key.Escape]);
        }
Ejemplo n.º 32
0
    public static List <string> Generate()
    {
        List <string> regionList = new List <string>();
        StringBuilder sb         = new StringBuilder();

        sb.Append("DOWNPOUR - Vanilla Regions: ");

        //Vanilla Regions
        if (File.Exists(Custom.RootFolderDirectory() + "/World/Regions/regions.txt"))
        {
            string[] vanillaRegions = File.ReadAllLines(Custom.RootFolderDirectory() + "/World/Regions/regions.txt");
            for (int i = 0; i < vanillaRegions.Length; i++)
            {
                if (!regionList.Contains(vanillaRegions[i]))
                {
                    regionList.Add(vanillaRegions[i]);
                    sb.Append(vanillaRegions[i] + ", ");
                }
            }
        }
        else
        {
            Debug.Log("Vanilla regions.txt does not exist, how did you even get this far?");
        }

        //Print Vanilla Regions
        Debug.Log(sb.ToString());
        sb = new StringBuilder();
        sb.Append("DOWNPOUR - Custom Regions: ");

        //Custom Regions
        if (Directory.Exists(string.Concat(new object[]
        {
            Custom.RootFolderDirectory(),
            "Mods",
            Path.DirectorySeparatorChar,
            "CustomResources"
        })))
        {
            foreach (string dir in Directory.GetDirectories(Custom.RootFolderDirectory() + "Mods" + Path.DirectorySeparatorChar + "CustomResources"))
            {
                //Region Folder
                if (Directory.Exists(dir + Path.DirectorySeparatorChar + "World" + Path.DirectorySeparatorChar + "Regions"))
                {
                    //Check whether CRS version is using regionInfo or packInfo
                    string jsonType = "";
                    if (Directory.GetFiles(dir).Contains(dir + Path.DirectorySeparatorChar + "packInfo.json"))
                    {
                        jsonType = "packInfo.json";
                    }
                    else if (Directory.GetFiles(dir).Contains(dir + Path.DirectorySeparatorChar + "regionInfo.json"))
                    {
                        jsonType = "regionInfo.json";
                    }
                    if (jsonType != "")
                    {
                        string[] crsRegion = new string[]
                        {
                            string.Empty
                        };
                        crsRegion = File.ReadAllLines(dir + Path.DirectorySeparatorChar + jsonType);
                        for (int i = 0; i < crsRegion.Length; i++)
                        {
                            if (crsRegion[i].Contains("activated"))
                            {
                                string[] crsLine = Regex.Split(crsRegion[i], ": ");
                                if (crsLine.Length > 0)
                                {
                                    if (crsLine[1].StartsWith("true"))
                                    {
                                        foreach (string reg in Directory.GetDirectories(dir + Path.DirectorySeparatorChar + "World" + Path.DirectorySeparatorChar + "Regions"))
                                        {
                                            string name = Path.GetFileName(reg);
                                            if (!regionList.Contains(name))
                                            {
                                                regionList.Add(name);
                                                sb.Append(name + ", ");
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            Debug.Log("CustomResources path was not found");
        }

        //Print Custom Regions
        Debug.Log(sb.ToString());

        return(regionList);
    }
Ejemplo n.º 33
0
 public TestPointer SetOther(Custom value) { this.other = value; return this; }
Ejemplo n.º 34
0
        private static void MenuScene_BuildScene(On.Menu.MenuScene.orig_BuildScene orig, MenuScene self)
        {
            // Automatically override scenes if the current character has a scene by the same name
            SlugBaseCharacter currentPlayer;

            if (PlayerManager.UsingCustomCharacter)
            {
                currentPlayer = PlayerManager.CurrentCharacter;
            }
            else
            {
                int index;
                if (self.menu.manager.currentMainLoop is RainWorldGame rwg)
                {
                    index = rwg.StoryCharacter;
                }
                else
                {
                    index = self.menu.manager.rainWorld.progression.PlayingAsSlugcat;
                }
                currentPlayer = PlayerManager.GetCustomPlayer(index);
            }

            if (currentPlayer != null)
            {
                string sceneName = self.sceneID.ToString();
                if (sceneOverride == null && currentPlayer.HasScene(sceneName))
                {
                    OverrideNextScene(currentPlayer, sceneName);
                }
            }

            if (sceneOverride != null)
            {
                try
                {
                    self.sceneFolder = resourceFolderName;

                    // Check for flatmode support
                    bool hasFlatmode = false;
                    foreach (var img in sceneOverride.Images)
                    {
                        if (img.HasTag("FLATMODE"))
                        {
                            hasFlatmode = true;
                            break;
                        }
                    }

                    // Load all images into the scene
                    for (int imgIndex = 0; imgIndex < sceneOverride.Images.Count; imgIndex++)
                    {
                        var img = sceneOverride.Images[imgIndex];

                        // Hide disabled images
                        if (!img.Enabled)
                        {
                            continue;
                        }

                        // Allow images to use their own sprites
                        if (!img.OnBuild(self))
                        {
                            continue;
                        }

                        // Skip this image if it is flatmode only and flatmode is disabled, and vice versa
                        bool flat         = img.depth < 0f;
                        bool flatmodeOnly = hasFlatmode && img.HasTag("flatmode");
                        if (hasFlatmode && (self.flatMode != flatmodeOnly))
                        {
                            continue;
                        }

                        // Parse alpha
                        float alpha = img.GetProperty <float?>("alpha") ?? 1f;

                        string  assetPath  = $"{sceneOverride.Owner.Name}\\Scenes\\{sceneOverride.Name}\\{img.assetName}";
                        Vector2 pos        = img.Pos;
                        bool    crisp      = img.HasTag("CRISP");
                        string  shaderName = img.GetProperty <string>("shader");
                        FShader shader     = null;

                        MenuIllustration illust;
                        if (flat)
                        {
                            // It's Friday

                            // Parse shader
                            if (shaderName != null)
                            {
                                if (!self.menu.manager.rainWorld.Shaders.TryGetValue(shaderName, out shader))
                                {
                                    shader = null;
                                }
                            }

                            // Add a flat illustration
                            illust = new MenuIllustration(self.menu, self, self.sceneFolder, assetPath, pos, crisp, false);
                            if (shader != null)
                            {
                                illust.sprite.shader = shader;
                            }
                        }
                        else
                        {
                            // Parse shader
                            MenuDepthIllustration.MenuShader menuShader = MenuDepthIllustration.MenuShader.Normal;
                            if (shaderName != null)
                            {
                                try
                                {
                                    menuShader = Custom.ParseEnum <MenuDepthIllustration.MenuShader>(shaderName);
                                    shader     = null;
                                }
                                catch
                                {
                                    if (!self.menu.manager.rainWorld.Shaders.TryGetValue(shaderName, out shader))
                                    {
                                        shader = null;
                                    }
                                    menuShader = MenuDepthIllustration.MenuShader.Normal;
                                }
                            }

                            // Add an illustration with depth
                            illust = new MenuDepthIllustration(self.menu, self, self.sceneFolder, assetPath, pos, img.Depth, menuShader);

                            // Apply crisp pixels
                            if (crisp)
                            {
                                illust.sprite.element.atlas.texture.filterMode = FilterMode.Point;
                            }
                        }

                        // Add idle depths
                        if (self is InteractiveMenuScene ims)
                        {
                            ims.idleDepths = new List <float>();
                            List <object> depths = sceneOverride.GetProperty <List <object> >("idledepths");
                            if (depths != null)
                            {
                                for (int i = 0; i < depths.Count; i++)
                                {
                                    if (depths[i] is double depth)
                                    {
                                        ims.idleDepths.Add((float)depth);
                                    }
                                }
                            }
                        }

                        // Apply tags
                        if (shader != null)
                        {
                            illust.sprite.shader = shader;
                        }
                        illust.setAlpha = alpha;
                        self.AddIllustration(illust);

                        // Link back to the custom scene image
                        customRep[illust] = img;
                    }
                }
                finally { ClearSceneOverride(); }
            }
            else
            {
                orig(self);
            }
        }
Ejemplo n.º 35
0
 /// <summary>
 /// Prevents a default instance of the <see cref="Mouse" /> class from being created.
 /// </summary>
 private Mouse()
 {
     Log.Info("Mouse is initializing");
     Chroma.Initialize();
     _custom = Custom.Create();
 }
Ejemplo n.º 36
0
    protected String Get_CallCenter_Phone()
    {
        userid = User.Identity.GetUserId <int>();
        var sp_callcenter = (ddlCallCenter.Text.Length > 0) ? ddlCallCenter.Text : null;

        var rtrn = "(888) 200-8300";

        try
        {
            #region SQL Connection
            using (SqlConnection con = new SqlConnection(Custom.connStr))
            {
                Custom.Database_Open(con);
                #region SQL Command
                using (SqlCommand cmd = new SqlCommand("", con))
                {
                    #region Build cmdText
                    String cmdText = "";
                    cmdText = @"
SELECT
TOP 1
[acc].[phone]
FROM [dbo].[application_call_center] [acc] WITH(NOLOCK)
WHERE 1=1
AND [acc].[status] = 10500010
AND [acc].[centerid] = @sp_callcenter
                            ";
                    #endregion Build cmdText

                    #region SQL Command Config
                    cmd.CommandTimeout = 600;
                    cmd.CommandText    = cmdText;
                    cmd.CommandType    = CommandType.Text;
                    cmd.Parameters.Clear();
                    #endregion SQL Command Config
                    #region SQL Command Parameters
                    cmd.Parameters.Add("@sp_userid", SqlDbType.Int).Value            = userid;
                    cmd.Parameters.Add("@sp_callcenter", SqlDbType.VarChar, 5).Value = (object)sp_callcenter ?? DBNull.Value;
                    #endregion SQL Command Parameters
                    // print_sql(cmd, "append"); // Will print for Admin in Local
                    #region SQL Command Processing
                    var chckResults = cmd.ExecuteScalar();
                    if (chckResults != null && (chckResults.ToString() != "0"))
                    {
                        // We updated at least 1 record, get the #
                        rtrn = chckResults.ToString();
                    }
                    else
                    {
                        // No Center
                    }
                    #endregion SQL Command Processing
                }
                #endregion SQL Command
            }
            #endregion SQL Connection
        }
        catch (Exception ex)
        {
            lblProcessMessage.Text = "Error getting call center";

            lblProcessMessage.Text += String.Format("<table class='table_error'>"
                                                    + "<tr><td>Error<td/><td>{0}</td></tr>"
                                                    + "<tr><td>Message<td/><td>{1}</td></tr>"
                                                    + "<tr><td>StackTrace<td/><td>{2}</td></tr>"
                                                    + "<tr><td>Source<td/><td>{3}</td></tr>"
                                                    + "<tr><td>InnerException<td/><td>{4}</td></tr>"
                                                    + "<tr><td>Data<td/><td>{5}</td></tr>"
                                                    + "</table>"
                                                    , "Email Sender"    //0
                                                    , ex.Message        //1
                                                    , ex.StackTrace     //2
                                                    , ex.Source         //3
                                                    , ex.InnerException //4
                                                    , ex.Data           //5
                                                    , ex.HelpLink
                                                    , ex.TargetSite
                                                    );
        }

        return(rtrn);
    }
Ejemplo n.º 37
0
        // Same as below, but for slideshows
        private static void SlideShow_ctor(On.Menu.SlideShow.orig_ctor orig, SlideShow self, ProcessManager manager, SlideShow.SlideShowID slideShowID)
        {
            // Automatically override slideshows if the current character has a slideshow by the same name
            SlugBaseCharacter currentPlayer;

            if (PlayerManager.UsingCustomCharacter)
            {
                currentPlayer = PlayerManager.CurrentCharacter;
            }
            else
            {
                int index;
                if (manager.currentMainLoop is RainWorldGame rwg)
                {
                    index = rwg.StoryCharacter;
                }
                else
                {
                    index = manager.rainWorld.progression.PlayingAsSlugcat;
                }
                currentPlayer = PlayerManager.GetCustomPlayer(index);
            }

            if (currentPlayer != null)
            {
                string slideshowName = self.slideShowID.ToString();
                if (slideshowOverride == null && currentPlayer.HasSlideshow(slideshowName))
                {
                    OverrideNextSlideshow(currentPlayer, slideshowName);
                }
            }

            if (slideshowOverride == null)
            {
                orig(self, manager, slideShowID);
                return;
            }

            try
            {
                // Call the original constructor, save a reference to the loading label
                // This will always be empty, due to the ID of -1
                FLabel loadingLabel = manager.loadingLabel;
                orig(self, manager, (SlideShow.SlideShowID)(-1));

                // Undo RemoveLoadingLabel and NextScene
                manager.loadingLabel = loadingLabel;
                Futile.stage.AddChild(loadingLabel);
                self.current = -1;

                // Load a custom scene

                SlugBaseCharacter     owner  = slideshowOverride.Owner;
                List <SlideshowSlide> slides = slideshowOverride.Slides;

                // Chose a destination process
                if (slideshowOverride.NextProcess == null)
                {
                    switch (slideShowID)
                    {
                    case SlideShow.SlideShowID.WhiteIntro:
                    case SlideShow.SlideShowID.YellowIntro:
                        self.nextProcess = ProcessManager.ProcessID.Game;
                        break;

                    case SlideShow.SlideShowID.WhiteOutro:
                    case SlideShow.SlideShowID.YellowOutro:
                    case SlideShow.SlideShowID.RedOutro:
                        self.nextProcess = ProcessManager.ProcessID.Credits;
                        break;

                    default:
                        // Take a best guess
                        // Accidentally going to the game is better than accidentally going to the credits
                        self.nextProcess = ProcessManager.ProcessID.Game;
                        break;
                    }
                }
                else
                {
                    self.nextProcess = slideshowOverride.NextProcess.Value;
                }

                // Custom music
                if (manager.musicPlayer != null)
                {
                    self.waitForMusic = slideshowOverride.Music;
                    self.stall        = true;
                    manager.musicPlayer.MenuRequestsSong(self.waitForMusic, 1.5f, 40f);
                }

                // Custom playlist
                float time = 0f;
                float endTime;
                self.playList.Clear();
                foreach (SlideshowSlide slide in slides)
                {
                    if (!slide.Enabled)
                    {
                        continue;
                    }
                    endTime = time + slide.Duration;
                    self.playList.Add(new SlideShow.Scene(MenuScene.SceneID.Empty, time, time + slide.FadeIn, endTime - slide.FadeOut));
                    time = endTime;
                }

                // Preload the scenes
                self.preloadedScenes = new SlideShowMenuScene[self.playList.Count];
                try
                {
                    for (int i = 0; i < self.preloadedScenes.Length; i++)
                    {
                        MenuScene.SceneID id = MenuScene.SceneID.Empty;
                        if (slideshowOverride.Owner.HasScene(slides[i].SceneName))
                        {
                            // Prioritize this character's scenes
                            OverrideNextScene(slideshowOverride.Owner, slideshowOverride.Slides[i].SceneName);
                        }
                        else
                        {
                            ClearSceneOverride();
                            try
                            {
                                // ... then try existing scenes
                                id = Custom.ParseEnum <MenuScene.SceneID>(slides[i].SceneName);
                            }
                            catch (Exception)
                            {
                                // ... and default to Empty
                                id = MenuScene.SceneID.Empty;
                            }
                        }
                        self.preloadedScenes[i] = new SlideShowMenuScene(self, self.pages[0], id);
                        self.preloadedScenes[i].Hide();

                        List <Vector3> camPath = self.preloadedScenes[i].cameraMovementPoints;
                        camPath.Clear();
                        camPath.AddRange(slides[i].CameraPath);
                    }
                }
                finally
                {
                    ClearSceneOverride();
                }
            }
            finally
            {
                ClearSlideshowOverride();
            }
            manager.RemoveLoadingLabel();
            self.NextScene();
        }
Ejemplo n.º 38
0
 private void Main()
 {
     var custom = new Custom(Scheduler.Immediate);
     custom.SimpleMethod();
 }
Ejemplo n.º 39
0
        public void ShouldGetWithGridIndexer()
        {
            var grid = new Custom(Color.Red);

            Assert.AreEqual(Color.Red, grid[3, 3]);
        }
Ejemplo n.º 40
0
 public override void opCustomIntS_async(AMD_MyClass_opCustomIntS cb, Custom<int> i, Ice.Current current)
 {
     cb.ice_response(i, i);
 }
Ejemplo n.º 41
0
 public override Task<MyClass_OpCustomIntSSResult> opCustomIntSSAsync(Custom<Custom<int>> i, Ice.Current current)
 {
     return Task.FromResult<MyClass_OpCustomIntSSResult>(new MyClass_OpCustomIntSSResult(i, i));
 }
Ejemplo n.º 42
0
 public override void ice_response(Custom<CV> r, Custom<CV> o)
 {
     IEnumerator<CV> eo = (IEnumerator<CV>)o.GetEnumerator();
     IEnumerator<CV> er = (IEnumerator<CV>)r.GetEnumerator();
     foreach(CV obj in _i)
     {
         eo.MoveNext();
         er.MoveNext();
         if(obj == null)
         {
             test(eo.Current == null);
             test(er.Current == null);
         }
         else
         {
             test(obj.i == ((CV)eo.Current).i);
             test(obj.i == ((CV)er.Current).i);
         }
     }
     callback.called();
 }
    // Token: 0x06001E25 RID: 7717 RVA: 0x001BDDA8 File Offset: 0x001BBFA8
    private Vector2 whiskerDir(int side, int m, Vector2 zRot, Vector2 bodyDir)
    {
        Vector2 vector = new Vector2(((side != 0) ? 1f : -1f) * Mathf.Abs(zRot.y) * this.whiskerDirections[m].x + zRot.x * this.whiskerProps[m, 1], this.whiskerDirections[m].y);

        return(Custom.RotateAroundOrigo(vector.normalized, Custom.VecToDeg(bodyDir)));
    }
Ejemplo n.º 44
0
 private static void LoadPalette(On.RoomCamera.orig_LoadPalette orig, RoomCamera self, int pal, ref Texture2D texture)
 {
     orig.Invoke(self, pal, ref texture);
     if (Downpour.paletteChange)
     {
         Room room = null;
         if (self.loadingRoom != null)
         {
             room = self.loadingRoom;
         }
         else if (self.room != null)
         {
             room = self.room;
         }
         if (room != null)
         {
             //Modify paletteTexture before orig is called.
             Color[] origPalette     = texture.GetPixels();
             Color[] modifiedPalette = new Color[origPalette.Length];
             float   darknessFade    = 1f - Mathf.Lerp(0f, texture.GetPixel(30, 7).r, room.roomSettings.RainIntensity);
             if (self.game.IsArenaSession)
             {
                 Color[] colors        = texture.GetPixels();
                 Color[] newColors     = new Color[colors.Length];
                 Color[] exterior1Cols = Downpour.snowExt1.GetPixels();
                 Color[] interior1Cols = Downpour.snowInt1.GetPixels();
                 for (int i = 0; i < colors.Length; i++)
                 {
                     //Rain
                     if (!Downpour.snow)
                     {
                         newColors[i] = Custom.Desaturate(colors[i], darkness * 0.05f);
                         newColors[i] = Color.Lerp(newColors[i], new Color(0f, 0f, 0f), darkness * 0.05f);
                         texture.SetPixels(newColors);
                     }
                     //Snow
                     else
                     {
                         if (RainFall.rainList.Contains(self.loadingRoom.abstractRoom.name))
                         {
                             newColors[i]     = colors[i];
                             exterior1Cols[i] = Color.Lerp(exterior1Cols[i], new Color(0f, 0f, 0f), 0f);
                             newColors[i]     = Custom.Screen(newColors[i], exterior1Cols[i]);
                             texture.SetPixels(newColors);
                         }
                         else
                         {
                             newColors[i] = colors[i];
                             newColors[i] = Custom.Screen(newColors[i], interior1Cols[i]);
                             texture.SetPixels(newColors);
                         }
                     }
                 }
             }
             else
             {
                 if (Downpour.snow)
                 {
                     //Determine palette needed
                     if (Downpour.rainRegions.Contains(room.world.region.name))
                     {
                         //Exterior
                         if (RainFall.rainList.Contains(room.abstractRoom.name))
                         {
                             Color[] snowPalette = Downpour.snowExt1.GetPixels();
                             for (int i = 0; i < modifiedPalette.Length; i++)
                             {
                                 modifiedPalette[i] = origPalette[i];
                                 modifiedPalette[i] = Custom.Desaturate(modifiedPalette[i], Mathf.Lerp(0.45f, 0f, darknessFade));
                                 snowPalette[i]     = Color.Lerp(snowPalette[i], new Color(0f, 0f, 0f), darknessFade);
                                 modifiedPalette[i] = Custom.Screen(modifiedPalette[i], snowPalette[i]);
                             }
                         }
                         //Interior
                         else
                         {
                             Color[] snowPalette = Downpour.snowInt1.GetPixels();
                             for (int i = 0; i < modifiedPalette.Length; i++)
                             {
                                 modifiedPalette[i] = origPalette[i];
                                 modifiedPalette[i] = Custom.Desaturate(modifiedPalette[i], Mathf.Lerp(0.45f, 0f, darknessFade));
                                 snowPalette[i]     = Color.Lerp(snowPalette[i], new Color(0f, 0f, 0f), darknessFade);
                                 modifiedPalette[i] = Custom.Screen(modifiedPalette[i], snowPalette[i]);
                             }
                         }
                         texture.SetPixels(modifiedPalette);
                         //Shortcut Symbol
                     }
                 }
                 else
                 {
                     Color[] colors    = texture.GetPixels();
                     Color[] newColors = new Color[colors.Length];
                     for (int i = 0; i < colors.Length; i++)
                     {
                         newColors[i] = Custom.Desaturate(colors[i], darkness * 0.05f);
                         newColors[i] = Color.Lerp(newColors[i], new Color(0f, 0f, 0f), darkness * 0.05f);
                     }
                     texture.SetPixels(newColors);
                 }
             }
         }
     }
 }
Ejemplo n.º 45
0
 /// <summary>
 /// Sets a <see cref="Custom" /> effect on the keypad.
 /// </summary>
 /// <param name="effect">An instance of the <see cref="Custom" /> struct.</param>
 public void SetCustom(Custom effect)
 {
     SetGuid(NativeWrapper.CreateKeypadEffect(effect));
 }
    // Token: 0x06001E2A RID: 7722 RVA: 0x001BE340 File Offset: 0x001BC540
    public override void DrawSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, float timeStacker, Vector2 camPos)
    {
        base.DrawSprites(sLeaser, rCam, timeStacker, camPos);
        if (this.culled)
        {
            return;
        }
        for (int i = 0; i < this.danglers.Length; i++)
        {
            this.danglers[i].DrawSprite(HeadDanglerSprite(i), sLeaser, rCam, timeStacker, camPos);
        }
        Vector2 vector23 = Vector2.Lerp(this.fish.bodyChunks[2].lastPos, this.fish.bodyChunks[2].pos, timeStacker);
        Vector2 vector24 = Vector2.Lerp(this.fish.mainBodyChunk.lastPos, this.fish.mainBodyChunk.pos, timeStacker);
        Vector2 a2       = Custom.DirVec(Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker), Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker));;
        Vector2 vector25 = Vector2.Lerp(this.fish.neck.connectedChunk.lastPos, this.fish.neck.connectedChunk.pos, timeStacker);
        float   thick    = 2f;
        float   num23    = 3f;

        for (int l = 0; l < this.fish.neck.tChunks.Length; l++)
        {
            Vector2 vector6 = Vector2.Lerp(this.fish.neck.tChunks[l].lastPos, this.fish.neck.tChunks[l].pos, timeStacker);
            if (l == this.fish.neck.tChunks.Length - 1)
            {
                vector6 = Vector2.Lerp(vector6, vector23, 0.5f);
                thick   = 1f;
            }
            else if (l == 0)
            {
                vector6 = Vector2.Lerp(vector6, vector24 + a2 * 40f, 0.3f);
            }
            Vector2 normalized1 = (vector6 - vector25).normalized;
            Vector2 a3          = Custom.PerpendicularVector(normalized1);
            float   d           = Vector2.Distance(vector6, vector25) / 5f;
            (sLeaser.sprites[this.NeckSprite] as TriangleMesh).MoveVertice(l * 4, vector25 - a3 * (this.fish.neck.tChunks[l].stretchedRad + num23) * 0.5f * thick + normalized1 * d * ((l != 0) ? 1f : 0f) - camPos);
            (sLeaser.sprites[this.NeckSprite] as TriangleMesh).MoveVertice(l * 4 + 1, vector25 + a3 * (this.fish.neck.tChunks[l].stretchedRad + num23) * 0.5f * thick + normalized1 * d * ((l != 0) ? 1f : 0f) - camPos);
            if (l == this.fish.neck.tChunks.Length - 1)
            {
                thick = 0.2f;
            }
            (sLeaser.sprites[this.NeckSprite] as TriangleMesh).MoveVertice(l * 4 + 2, vector6 - a3 * this.fish.neck.tChunks[l].stretchedRad * thick - normalized1 * d * ((l != this.fish.neck.tChunks.Length - 1) ? 1f : 0f) - camPos);
            (sLeaser.sprites[this.NeckSprite] as TriangleMesh).MoveVertice(l * 4 + 3, vector6 + a3 * this.fish.neck.tChunks[l].stretchedRad * thick - normalized1 * d * ((l != this.fish.neck.tChunks.Length - 1) ? 1f : 0f) - camPos);
            num23    = this.fish.neck.tChunks[l].stretchedRad;
            vector25 = vector6;
        }

        Vector2 vector     = Vector3.Slerp(this.lastZRotation, this.zRotation, timeStacker);
        Vector2 vector2    = Vector2.Lerp(Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker), Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker), 0.3f);
        Vector2 normalized = (Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker) - Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker)).normalized;
        Vector2 a          = Custom.PerpendicularVector(-normalized);
        float   num        = Custom.AimFromOneVectorToAnother(normalized, -normalized);
        float   num2       = Custom.AimFromOneVectorToAnother(new Vector2(0f, 0f), vector);
        int     num3       = Custom.IntClamp(8 - (int)(Mathf.Abs(num2 / 180f) * 9f), 0, 8);
        float   num4       = (float)(8 - num3) * Mathf.Sign(num2) * 22.5f;

        //float wingLength = Mathf.Abs(Mathf.Clamp(8f - (Mathf.Abs(Custom.AimFromOneVectorToAnother(new Vector2(0f, 0f), Vector3.Slerp(this.lastZRotation, this.zRotation, timeStacker)) / 180f) * 9f), 0f, 8f) - 4f) / 4f;
        sLeaser.sprites[this.BodySprite].x        = vector2.x - camPos.x;
        sLeaser.sprites[this.BodySprite].y        = vector2.y - camPos.y;
        sLeaser.sprites[this.BodySprite].element  = Futile.atlasManager.GetElementWithName("SeaDrake" + num3);
        sLeaser.sprites[this.BodySprite].rotation = num - num4;
        sLeaser.sprites[this.BodySprite].scaleX   = ((num2 <= 0f) ? Mathf.Lerp(0.3f, 0.6f, this.fish.iVars.fatness) : -Mathf.Lerp(0.3f, 0.6f, this.fish.iVars.fatness));

        //vector = Custom.DirVec(Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 3].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length-3].pos, timeStacker), Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].pos, timeStacker));
        num2 = Custom.VecToDeg(-vector);
        num3 = Custom.IntClamp(8 - (int)(Mathf.Abs(num2 / 180f) * 9f), 0, 8);
        num4 = (float)(8 - num3) * Mathf.Sign(num2) * 22.5f;

        sLeaser.sprites[this.HeadSprite].x        = Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].pos, timeStacker).x - camPos.x;
        sLeaser.sprites[this.HeadSprite].y        = Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].pos, timeStacker).y - camPos.y;
        sLeaser.sprites[this.HeadSprite].element  = Futile.atlasManager.GetElementWithName("SeaDrakeHead" + num3);
        sLeaser.sprites[this.HeadSprite].rotation = num2 - num4;
        sLeaser.sprites[this.HeadSprite].scaleX   = ((num2 <= 0f) ? 0.6f : -0.6f);

        num2 = Custom.VecToDeg(-vector);
        num3 = Custom.IntClamp(8 - (int)(Mathf.Abs(num2 / 180f) * 9f), 0, 8);
        num4 = (float)(8 - num3) * Mathf.Sign(num2) * 22.5f;

        sLeaser.sprites[this.JawSprite].x        = Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].pos, timeStacker).x - camPos.x + Custom.DegToVec(num2).x * 10f;
        sLeaser.sprites[this.JawSprite].y        = Vector2.Lerp(this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].lastPos, this.fish.neck.tChunks[this.fish.neck.tChunks.Length - 2].pos, timeStacker).y - camPos.y + Custom.DegToVec(num2).y * 10f;
        sLeaser.sprites[this.JawSprite].element  = Futile.atlasManager.GetElementWithName("SeaDrakeJaw" + num3);
        sLeaser.sprites[this.JawSprite].rotation = num2 - num4;
        sLeaser.sprites[this.JawSprite].scaleX   = ((num2 <= 0f) ? 0.7f : -0.7f);

        vector     = Vector3.Slerp(this.lastZRotation, this.zRotation, timeStacker);
        vector2    = Vector2.Lerp(Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker), Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker), 0.3f);
        normalized = (Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker) - Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker)).normalized;
        a          = Custom.PerpendicularVector(-normalized);
        num        = Custom.AimFromOneVectorToAnother(normalized, -normalized);
        num2       = Custom.AimFromOneVectorToAnother(new Vector2(0f, 0f), vector);
        num3       = Custom.IntClamp(8 - (int)(Mathf.Abs(num2 / 180f) * 9f), 0, 8);
        num4       = (float)(8 - num3) * Mathf.Sign(num2) * 22.5f;

        Vector2 vector33 = Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker);
        float   num55    = this.fish.bodyChunks[1].rad / 2f;

        for (int j = 0; j < this.tail.Length; j++)
        {
            Vector2 vector4     = Vector2.Lerp(this.tail[j].lastPos, this.tail[j].pos, timeStacker);
            Vector2 normalized2 = (vector4 - vector33).normalized;
            Vector2 a3          = Custom.PerpendicularVector(normalized2);
            float   d           = Vector2.Distance(vector4, vector33) / 5f;
            (sLeaser.sprites[this.TentacleSprite()] as TriangleMesh).MoveVertice(j * 4, vector33 - a3 * 2f * (num55 + this.tail[j].StretchedRad) * 0.5f + normalized2 * d - camPos);
            (sLeaser.sprites[this.TentacleSprite()] as TriangleMesh).MoveVertice(j * 4 + 1, vector33 + a3 * 2f * (num55 + this.tail[j].StretchedRad) * 0.5f + normalized2 * d - camPos);
            if (j < this.tail.Length - 1)
            {
                (sLeaser.sprites[this.TentacleSprite()] as TriangleMesh).MoveVertice(j * 4 + 2, vector4 - a3 * 2f * this.tail[j].StretchedRad - normalized2 * d - camPos);
                (sLeaser.sprites[this.TentacleSprite()] as TriangleMesh).MoveVertice(j * 4 + 3, vector4 + a3 * 2f * this.tail[j].StretchedRad - normalized2 * d - camPos);
            }
            else
            {
                (sLeaser.sprites[this.TentacleSprite()] as TriangleMesh).MoveVertice(j * 4 + 2, vector4 - camPos);
            }
            num55    = this.tail[j].StretchedRad;
            vector33 = vector4;
        }

        float wingLength = Mathf.Abs(Mathf.Clamp(8f - (Mathf.Abs(Custom.AimFromOneVectorToAnother(new Vector2(0f, 0f), this.zRotation) / 180f) * 9f), 0f, 8f) - 4f) / 4f;

        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < this.wings.GetLength(1); j++)
            {
                vector33 = Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker);
                num55    = this.fish.bodyChunks[0].rad;
                Vector2 vector4     = Vector2.Lerp(this.wings[i, j].lastPos, this.wings[i, j].pos, timeStacker);
                Vector2 normalized2 = (vector4 - vector33).normalized;
                Vector2 a3          = Custom.PerpendicularVector(normalized2);
                float   d           = Vector2.Distance(vector4, vector33) / 5f;
                (sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4, vector33 - a3 * (num55 + this.wings[i, j].StretchedRad) * 0.5f + normalized2 * d - camPos);
                (sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 1, vector33 + a3 * (num55 + this.wings[i, j].StretchedRad) * 0.5f + normalized2 * d - camPos);
                //(sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 1, Vector2.Lerp(this.fish.bodyChunks[0].lastPos, this.fish.bodyChunks[0].pos, timeStacker) - camPos);
                if (j < this.wings.GetLength(1) - 1)
                {
                    (sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 2, vector4 - a3 * this.wings[i, j].StretchedRad - normalized2 * d - camPos);
                    (sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 3, vector4 + a3 * this.wings[i, j].StretchedRad - normalized2 * d - camPos);
                    //(sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 3, Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker) - camPos);
                }
                else
                {
                    (sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).MoveVertice(j * 4 + 2, vector4 - camPos);
                }
                //(sLeaser.sprites[this.WingSprite(i)] as TriangleMesh).scale = wingLength;
                num55    = this.wings[i, j].StretchedRad;
                vector33 = vector4;
            }
        }

        for (int i = 0; i < 2; i++)
        {
            //Vector2 a2 = vector2 + normalized * 13f + a * Mathf.Cos(num2 / 360f * 3.14159274f * 2f) * Mathf.Lerp(7.5f, 5f, this.airEyes) * ((i == 0 != num2 > 0f) ? 1f : -1f);
            sLeaser.sprites[this.FlipperSprite(i)].x        = Mathf.Lerp(this.flippers[i].lastPos.x, this.flippers[i].pos.x, timeStacker) - camPos.x;
            sLeaser.sprites[this.FlipperSprite(i)].y        = Mathf.Lerp(this.flippers[i].lastPos.y, this.flippers[i].pos.y, timeStacker) - camPos.y;
            sLeaser.sprites[this.FlipperSprite(i)].rotation = Custom.AimFromOneVectorToAnother(Vector2.Lerp(this.flippers[i].lastPos, this.flippers[i].pos, timeStacker), vector2) - 90f;
            sLeaser.sprites[this.FlipperSprite(i)].scaleY   = Mathf.Sign(Custom.DistanceToLine(Vector2.Lerp(this.flippers[i].lastPos, this.flippers[i].pos, timeStacker), vector2 - normalized, vector2 + normalized)) * this.fish.iVars.flipperSize;
            sLeaser.sprites[this.FlipperSprite(i)].scaleX   = Mathf.Lerp(Vector2.Distance(Vector2.Lerp(this.flippers[i].lastPos, this.flippers[i].pos, timeStacker), vector2) / this.flipperGraphWidth, this.fish.iVars.flipperSize, 0.5f);
            Vector2 vector3 = Vector2.Lerp(this.fish.bodyChunks[1].lastPos, this.fish.bodyChunks[1].pos, timeStacker);
            float   num5    = this.fish.bodyChunks[1].rad;
            for (int k = 0; k < this.fish.iVars.whiskers; k++)
            {
                for (int l = 0; l < 2; l++)
                {
                    Vector2 vector5 = Vector2.Lerp(this.whiskers[l, k].lastPos, this.whiskers[l, k].pos, timeStacker);
                    Vector2 a4      = this.whiskerDir(l, k, vector, normalized);
                    Vector2 vector6 = Vector2.Lerp(this.fish.bodyChunks[2].lastPos, this.fish.bodyChunks[2].pos, timeStacker) + normalized * Mathf.Lerp(10f, 5f, this.whiskerProps[k, 3]) + a4 * 5f * this.whiskerProps[k, 3];
                    a4      = (a4 + normalized).normalized;
                    vector3 = vector6;
                    num5    = this.whiskerProps[k, 4];
                    float num6 = 1f;
                    for (int m = 0; m < 4; m++)
                    {
                        Vector2 vector7;
                        if (m < 3)
                        {
                            vector7  = Vector2.Lerp(vector6, vector5, (float)(m + 1) / 4f);
                            vector7 += a4 * num6 * this.whiskerProps[k, 0] * 0.2f;
                        }
                        else
                        {
                            vector7 = vector5;
                        }
                        num6 *= 0.7f;
                        Vector2 normalized3 = (vector7 - vector3).normalized;
                        Vector2 a5          = Custom.PerpendicularVector(normalized3);
                        float   d2          = Vector2.Distance(vector7, vector3) / ((m != 0) ? 5f : 1f);
                        float   num7        = Custom.LerpMap((float)m, 0f, 3f, this.whiskerProps[k, 4], 0.5f);
                        (sLeaser.sprites[this.WhiskerSprite(l, k)] as TriangleMesh).MoveVertice(m * 4, vector3 - a5 * (num7 + num5) * 0.5f + normalized3 * d2 - camPos);
                        (sLeaser.sprites[this.WhiskerSprite(l, k)] as TriangleMesh).MoveVertice(m * 4 + 1, vector3 + a5 * (num7 + num5) * 0.5f + normalized3 * d2 - camPos);
                        if (m < 3)
                        {
                            (sLeaser.sprites[this.WhiskerSprite(l, k)] as TriangleMesh).MoveVertice(m * 4 + 2, vector7 - a5 * num7 - normalized3 * d2 - camPos);
                            (sLeaser.sprites[this.WhiskerSprite(l, k)] as TriangleMesh).MoveVertice(m * 4 + 3, vector7 + a5 * num7 - normalized3 * d2 - camPos);
                        }
                        else
                        {
                            (sLeaser.sprites[this.WhiskerSprite(l, k)] as TriangleMesh).MoveVertice(m * 4 + 2, vector7 + normalized3 * 2.1f - camPos);
                        }
                        num5    = num7;
                        vector3 = vector7;
                    }
                }
            }
        }
    }
Ejemplo n.º 47
0
 public static void Main()
 {
     var custom = new Custom(Scheduler.Immediate);
     custom.OverloadedMethodHasOptionalScheduler(42, "42", 42.00).Subscribe();
 }
    public Vector2 DanglerConnection(int index, float timeStacker)
    {
        int seed = UnityEngine.Random.seed;

        UnityEngine.Random.seed = danglerSeeds[index];
        Vector2 value     = new Vector2(0f, 0f);
        Vector2 randomDir = Custom.DegToVec(UnityEngine.Random.Range(0f, 360f));

        if (index < this.headDanglers)
        {
            value = Vector2.Lerp(this.fish.bodyChunks[2].lastPos, this.fish.bodyChunks[2].pos, timeStacker) + randomDir * this.fish.bodyChunks[2].rad;
        }
        else if (index < this.neckDanglers + this.headDanglers)
        {
            int loc = (int)UnityEngine.Random.Range(0f, 2f);
            if (loc == 0)
            {
                value = Vector2.Lerp(this.fish.neck.tChunks[loc].lastPos, this.fish.neck.tChunks[loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.fish.neck.tChunks[loc].pos, this.fish.neck.tChunks[loc + 1].pos);
            }
            else
            {
                value = Vector2.Lerp(this.fish.neck.tChunks[loc].lastPos, this.fish.neck.tChunks[loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.fish.neck.tChunks[loc].pos, this.fish.neck.tChunks[loc - 1].pos);
            }
        }
        else if (index - this.neckDanglers + this.headDanglers < this.wingDanglers)
        {
            int loc = (int)UnityEngine.Random.Range(0f, 9f);
            if (loc == 0)
            {
                value = Vector2.Lerp(this.wings[0, loc].lastPos, this.wings[0, loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.wings[0, loc].pos, this.wings[0, loc + 1].pos);
            }
            else
            {
                value = Vector2.Lerp(this.wings[0, loc].lastPos, this.wings[0, loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.wings[0, loc].pos, this.wings[0, loc - 1].pos);
            }
            value = Vector2.Lerp(value, Vector2.Lerp(this.fish.bodyChunks[0].lastLastPos, this.fish.bodyChunks[0].pos, timeStacker), 0.3f);
        }
        else
        {
            int loc = (int)UnityEngine.Random.Range(0f, 9f);
            if (loc == 0)
            {
                value = Vector2.Lerp(this.wings[1, loc].lastPos, this.wings[1, loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.wings[1, loc].pos, this.wings[1, loc + 1].pos);
            }
            else
            {
                value = Vector2.Lerp(this.wings[1, loc].lastPos, this.wings[1, loc].pos, timeStacker) + UnityEngine.Random.Range(0f, 5f) * Custom.DirVec(this.wings[1, loc].pos, this.wings[1, loc - 1].pos);
            }
            value = Vector2.Lerp(value, Vector2.Lerp(this.fish.bodyChunks[0].lastLastPos, this.fish.bodyChunks[0].pos, timeStacker), 0.3f);
        }
        UnityEngine.Random.seed = seed;
        return(value);
    }
Ejemplo n.º 49
0
 public static void Main()
 {
     var custom = new Custom(Scheduler.Immediate);
     custom.ComplexMethod(GetComplexMethodParameter()).Subscribe();
 }
    public SeaDrakeGraphics(SeaDrake ow) : base(ow, false)
    {
        this.fish         = ow;
        headDanglers      = 6;
        neckDanglers      = 8;
        wingDanglers      = 18;
        this.danglers     = new Dangler[headDanglers + neckDanglers + 2 * wingDanglers];
        this.danglerSeeds = new int[this.danglers.Length];
        this.danglerProps = new float[this.danglers.Length, 3];
        this.danglerVals  = new Dangler.DanglerProps();

        for (int i = 0; i < this.danglers.Length; i++)
        {
            this.danglerSeeds[i]    = UnityEngine.Random.Range(0, int.MaxValue);
            this.danglers[i]        = new Dangler(this, i, UnityEngine.Random.Range(4, 12), 5f, 5f);
            this.danglerProps[i, 0] = Mathf.Pow(UnityEngine.Random.value, 0.6f);
            this.danglerProps[i, 1] = Mathf.Lerp(2f, 5f, UnityEngine.Random.value);
            this.danglerProps[i, 2] = UnityEngine.Random.value;
            float num = Mathf.Lerp(4f, 8f, UnityEngine.Random.value) * Mathf.Lerp(0.5f, 1.5f, UnityEngine.Random.value);
            for (int j = 0; j < this.danglers[i].segments.Length; j++)
            {
                this.danglers[i].segments[j].rad    = Mathf.Lerp(Mathf.Lerp(1f, 0.5f, UnityEngine.Random.value), 0.5f + Mathf.Sin(Mathf.Pow(UnityEngine.Random.value, 2.5f) * 3.14159274f) * 0.5f, UnityEngine.Random.value) * num;
                this.danglers[i].segments[j].conRad = UnityEngine.Random.Range(0f, 1.3f);
            }
        }

        this.bodyParts = new BodyPart[6 + 2 + 16 + this.fish.iVars.whiskers * 2];

        this.tail = new TailSegment[6];
        for (int j = 0; j < this.tail.Length; j++)
        {
            this.tail[j]      = new TailSegment(this, Mathf.Lerp(3f, 1f, (float)j / (float)(this.tail.Length - 1)), 15f, (j != 0) ? this.tail[j - 1] : null, 0.5f, 0.99f, 0.4f, false);
            this.bodyParts[j] = this.tail[j];
        }

        this.wings = new TailSegment[2, 10];
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < this.wings.GetLength(1); j++)
            {
                this.wings[i, j] = new TailSegment(this, Mathf.Lerp(3f, 1f, (float)j / (float)(this.wings.GetLength(1) - 1)), 15f, (j != 0) ? this.wings[i, j - 1] : null, 0.5f, 0.99f, 0.4f, false);
                this.bodyParts[8 + (8 * i) + j] = this.wings[i, j];
            }
        }

        int seed = UnityEngine.Random.seed;

        UnityEngine.Random.seed = this.fish.iVars.whiskerSeed;

        this.whiskers          = new GenericBodyPart[2, this.fish.iVars.whiskers];
        this.whiskerDirections = new Vector2[this.fish.iVars.whiskers];
        this.whiskerProps      = new float[this.fish.iVars.whiskers, 5];
        for (int k = 0; k < this.fish.iVars.whiskers; k++)
        {
            this.whiskers[0, k]                = new GenericBodyPart(this, 1f, 0.6f, 0.9f, this.fish.bodyChunks[2]);
            this.whiskers[1, k]                = new GenericBodyPart(this, 1f, 0.6f, 0.9f, this.fish.bodyChunks[2]);
            this.whiskerDirections[k]          = Custom.DegToVec(Mathf.Lerp(4f, 80f, UnityEngine.Random.value));
            this.whiskerProps[k, 0]            = Mathf.Lerp(7f, 40f, Mathf.Pow(UnityEngine.Random.value, 2f));
            this.whiskerProps[k, 1]            = Mathf.Lerp(-1f, 0.5f, UnityEngine.Random.value);
            this.whiskerProps[k, 2]            = Mathf.Lerp(5f, 720f, Mathf.Pow(UnityEngine.Random.value, 1.5f)) / this.whiskerProps[k, 0];
            this.whiskerProps[k, 3]            = UnityEngine.Random.value;
            this.whiskerProps[k, 4]            = Mathf.Lerp(0.6f, 1.6f, Mathf.Pow(UnityEngine.Random.value, 2f));
            this.bodyParts[8 + 16 + k * 2]     = this.whiskers[0, k];
            this.bodyParts[8 + 16 + k * 2 + 1] = this.whiskers[1, k];
        }

        UnityEngine.Random.seed = seed;

        this.flippers = new GenericBodyPart[2];
        for (int l = 0; l < 2; l++)
        {
            this.flippers[l]      = new GenericBodyPart(this, 1f, 0.7f, 0.99f, this.fish.bodyChunks[1]);
            this.bodyParts[6 + l] = this.flippers[l];
        }
    }
Ejemplo n.º 51
0
    internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            byte[] i = new byte[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (byte)c;
            }
            byte[] o;
            byte[] r;

            r = p.opAByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<byte> i = new List<byte>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((byte)c);
            }
            List<byte> o;
            List<byte> r;

            r = p.opLByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<byte> i = new LinkedList<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((byte)c);
            }
            LinkedList<byte> o;
            LinkedList<byte> r;

            r = p.opKByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<byte> i = new Queue<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((byte)c);
            }
            Queue<byte> o;
            Queue<byte> r;

            r = p.opQByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<byte> i = new Stack<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((byte)c);
            }
            Stack<byte> o;
            Stack<byte> r;

            r = p.opSByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CByteS i = new CByteS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((byte)c);
            }
            CByteS o;
            CByteS r;

            r = p.opCByteS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            bool[] i = new bool[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = c % 1 == 1;
            }
            bool[] o;
            bool[] r;

            r = p.opABoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<bool> i = new List<bool>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c % 1 == 1);
            }
            List<bool> o;
            List<bool> r;

            r = p.opLBoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<bool> i = new LinkedList<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(c % 1 == 1);
            }
            LinkedList<bool> o;
            LinkedList<bool> r;

            r = p.opKBoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<bool> i = new Queue<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(c % 1 == 1);
            }
            Queue<bool> o;
            Queue<bool> r;

            r = p.opQBoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<bool> i = new Stack<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(c % 1 == 1);
            }
            Stack<bool> o;
            Stack<bool> r;

            r = p.opSBoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CBoolS i = new CBoolS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c % 1 == 1);
            }
            CBoolS o;
            CBoolS r;

            r = p.opCBoolS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            short[] i = new short[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (short)c;
            }
            short[] o;
            short[] r;

            {
                r = p.opAShortS(i, out o);
            }
            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<short> i = new List<short>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((short)c);
            }
            List<short> o;
            List<short> r;

            r = p.opLShortS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<short> i = new LinkedList<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((short)c);
            }
            LinkedList<short> o;
            LinkedList<short> r;

            r = p.opKShortS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<short> i = new Queue<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((short)c);
            }
            Queue<short> o;
            Queue<short> r;

            r = p.opQShortS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<short> i = new Stack<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((short)c);
            }
            Stack<short> o;
            Stack<short> r;

            r = p.opSShortS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CShortS i = new CShortS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((short)c);
            }
            CShortS o;
            CShortS r;

            r = p.opCShortS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            int[] i = new int[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (int)c;
            }
            int[] o;
            int[] r;

            r = p.opAIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<int> i = new List<int>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((int)c);
            }
            List<int> o;
            List<int> r;

            r = p.opLIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<int> i = new LinkedList<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((int)c);
            }
            LinkedList<int> o;
            LinkedList<int> r;

            r = p.opKIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<int> i = new Queue<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((int)c);
            }
            Queue<int> o;
            Queue<int> r;

            r = p.opQIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<int> i = new Stack<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((int)c);
            }
            Stack<int> o;
            Stack<int> r;

            r = p.opSIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CIntS i = new CIntS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((int)c);
            }
            CIntS o;
            CIntS r;

            r = p.opCIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            long[] i = new long[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (long)c;
            }
            long[] o;
            long[] r;

            r = p.opALongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<long> i = new List<long>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((long)c);
            }
            List<long> o;
            List<long> r;

            r = p.opLLongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<long> i = new LinkedList<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((long)c);
            }
            LinkedList<long> o;
            LinkedList<long> r;

            r = p.opKLongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<long> i = new Queue<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((long)c);
            }
            Queue<long> o;
            Queue<long> r;

            r = p.opQLongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<long> i = new Stack<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((long)c);
            }
            Stack<long> o;
            Stack<long> r;

            r = p.opSLongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CLongS i = new CLongS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((long)c);
            }
            CLongS o;
            CLongS r;

            r = p.opCLongS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            float[] i = new float[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (float)c;
            }
            float[] o;
            float[] r;

            r = p.opAFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<float> i = new List<float>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((float)c);
            }
            List<float> o;
            List<float> r;

            r = p.opLFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<float> i = new LinkedList<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((float)c);
            }
            LinkedList<float> o;
            LinkedList<float> r;

            r = p.opKFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<float> i = new Queue<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((float)c);
            }
            Queue<float> o;
            Queue<float> r;

            r = p.opQFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<float> i = new Stack<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((float)c);
            }
            Stack<float> o;
            Stack<float> r;

            r = p.opSFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CFloatS i = new CFloatS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((float)c);
            }
            CFloatS o;
            CFloatS r;

            r = p.opCFloatS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            double[] i = new double[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (double)c;
            }
            double[] o;
            double[] r;

            r = p.opADoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<double> i = new List<double>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((double)c);
            }
            List<double> o;
            List<double> r;

            r = p.opLDoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<double> i = new LinkedList<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((double)c);
            }
            LinkedList<double> o;
            LinkedList<double> r;

            r = p.opKDoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<double> i = new Queue<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((double)c);
            }
            Queue<double> o;
            Queue<double> r;

            r = p.opQDoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<double> i = new Stack<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((double)c);
            }
            Stack<double> o;
            Stack<double> r;

            r = p.opSDoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CDoubleS i = new CDoubleS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((double)c);
            }
            CDoubleS o;
            CDoubleS r;

            r = p.opCDoubleS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            string[] i = new string[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = c.ToString();
            }
            string[] o;
            string[] r;

            r = p.opAStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<string> i = new List<string>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c.ToString());
            }
            List<string> o;
            List<string> r;

            r = p.opLStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<string> i = new LinkedList<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(c.ToString());
            }
            LinkedList<string> o;
            LinkedList<string> r;

            r = p.opKStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<string> i = new Queue<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(c.ToString());
            }
            Queue<string> o;
            Queue<string> r;

            r = p.opQStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<string> i = new Stack<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(c.ToString());
            }
            Stack<string> o;
            Stack<string> r;

            r = p.opSStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CStringS i = new CStringS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c.ToString());
            }
            CStringS o;
            CStringS r;

            r = p.opCStringS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Ice.Object[] i = new CV[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CV(c);
            }
            Ice.Object[] o;
            Ice.Object[] r;

            r = p.opAObjectS(i, out o);

            System.Collections.IEnumerator eo = o.GetEnumerator();
            System.Collections.IEnumerator er = r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == ((CV)eo.Current).i);
                test(obj.i == ((CV)er.Current).i);
            }
        }

        {
            List<Ice.Object> i = new List<Ice.Object>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            List<Ice.Object> o;
            List<Ice.Object> r;

            r = p.opLObjectS(i, out o);

            IEnumerator<Ice.Object> eo = o.GetEnumerator();
            IEnumerator<Ice.Object> er = r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == ((CV)eo.Current).i);
                test(obj.i == ((CV)er.Current).i);
            }
        }

        {
            CObjectS i = new CObjectS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            CObjectS o;
            CObjectS r;

            r = p.opCObjectS(i, out o);

            IEnumerator<Ice.Object> eo = (IEnumerator<Ice.Object>)o.GetEnumerator();
            IEnumerator<Ice.Object> er = (IEnumerator<Ice.Object>)r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == ((CV)eo.Current).i);
                test(obj.i == ((CV)er.Current).i);
            }
        }

        {
            Ice.ObjectPrx[] i = new Ice.ObjectPrx[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = communicator.stringToProxy(c.ToString());
            }
            Ice.ObjectPrx[] o;
            Ice.ObjectPrx[] r;

            r = p.opAObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<Ice.ObjectPrx> i = new List<Ice.ObjectPrx>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(communicator.stringToProxy(c.ToString()));
            }
            List<Ice.ObjectPrx> o;
            List<Ice.ObjectPrx> r;

            r = p.opLObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<Ice.ObjectPrx> i = new LinkedList<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(communicator.stringToProxy(c.ToString()));
            }
            LinkedList<Ice.ObjectPrx> o;
            LinkedList<Ice.ObjectPrx> r;

            r = p.opKObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<Ice.ObjectPrx> i = new Queue<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(communicator.stringToProxy(c.ToString()));
            }
            Queue<Ice.ObjectPrx> o;
            Queue<Ice.ObjectPrx> r;

            r = p.opQObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<Ice.ObjectPrx> i = new Stack<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(communicator.stringToProxy(c.ToString()));
            }
            Stack<Ice.ObjectPrx> o;
            Stack<Ice.ObjectPrx> r;

            r = p.opSObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CObjectPrxS i = new CObjectPrxS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(communicator.stringToProxy(c.ToString()));
            }
            CObjectPrxS o;
            CObjectPrxS r;

            r = p.opCObjectPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            S[] i = new S[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c].i = c;
            }
            S[] o;
            S[] r;

            r = p.opAStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<S> i = new List<S>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new S(c));
            }
            List<S> o;
            List<S> r;

            r = p.opLStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<S> i = new LinkedList<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(new S(c));
            }
            LinkedList<S> o;
            LinkedList<S> r;

            r = p.opKStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<S> i = new Queue<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(new S(c));
            }
            Queue<S> o;
            Queue<S> r;

            r = p.opQStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<S> i = new Stack<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(new S(c));
            }
            Stack<S> o;
            Stack<S> r;


            r = p.opSStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CStructS i = new CStructS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new S(c));
            }
            CStructS o;
            CStructS r;

            r = p.opCStructS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            SD[] i = new SD[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new SD(c);
            }
            SD[] o;
            SD[] r;

            r = p.opAStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<SD> i = new List<SD>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new SD(c));
            }
            List<SD> o;
            List<SD> r;

            r = p.opLStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<SD> i = new LinkedList<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(new SD(c));
            }
            LinkedList<SD> o;
            LinkedList<SD> r;

            r = p.opKStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<SD> i = new Queue<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(new SD(c));
            }
            Queue<SD> o;
            Queue<SD> r;

            r = p.opQStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<SD> i = new Stack<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(new SD(c));
            }
            Stack<SD> o;
            Stack<SD> r;


            r = p.opSStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CStructSD i = new CStructSD(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new SD(c));
            }
            CStructSD o;
            CStructSD r;

            r = p.opCStructSD(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CV[] i = new CV[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CV(c);
            }
            CV[] o;
            CV[] r;

            r = p.opACVS(i, out o);

            System.Collections.IEnumerator eo = o.GetEnumerator();
            System.Collections.IEnumerator er = r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == ((CV)eo.Current).i);
                test(obj.i == ((CV)er.Current).i);
            }
        }

        {
            List<CV> i = new List<CV>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            List<CV> o;
            List<CV> r;

            r = p.opLCVS(i, out o);

            IEnumerator<CV> eo = o.GetEnumerator();
            IEnumerator<CV> er = r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == eo.Current.i);
                test(obj.i == er.Current.i);
            }
        }

        {
            CCVS i = new CCVS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            CCVS o;
            CCVS r;

            r = p.opCCVS(i, out o);

            IEnumerator<CV> eo = (IEnumerator<CV>)o.GetEnumerator();
            IEnumerator<CV> er = (IEnumerator<CV>)r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.i == eo.Current.i);
                test(obj.i == er.Current.i);
            }
        }

        {
            CR[] i = new CR[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CR(new CV(c));
            }
            CR[] o;
            CR[] r;

            r = p.opACRS(i, out o);

            System.Collections.IEnumerator eo = o.GetEnumerator();
            System.Collections.IEnumerator er = r.GetEnumerator();
            foreach(CR obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.v.i == ((CR)eo.Current).v.i);
                test(obj.v.i == ((CR)er.Current).v.i);
            }
        }

        {
            List<CR> i = new List<CR>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CR(new CV(c)));
            }
            List<CR> o;
            List<CR> r;

            r = p.opLCRS(i, out o);

            IEnumerator<CR> eo = o.GetEnumerator();
            IEnumerator<CR> er = r.GetEnumerator();
            foreach(CR obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.v.i == eo.Current.v.i);
                test(obj.v.i == er.Current.v.i);
            }
        }

        {
            CCRS i = new CCRS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CR(new CV(c)));
            }
            CCRS o;
            CCRS r;

            r = p.opCCRS(i, out o);

            IEnumerator<CR> eo = (IEnumerator<CR>)o.GetEnumerator();
            IEnumerator<CR> er = (IEnumerator<CR>)r.GetEnumerator();
            foreach(CR obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                test(obj.v.i == eo.Current.v.i);
                test(obj.v.i == er.Current.v.i);
            }
        }

        {
            En[] i = new En[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (En)(c % 3);
            }
            En[] o;
            En[] r;

            r = p.opAEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<En> i = new List<En>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((En)(c % 3));
            }
            List<En> o;
            List<En> r;

            r = p.opLEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<En> i = new LinkedList<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((En)(c % 3));
            }
            LinkedList<En> o;
            LinkedList<En> r;

            r = p.opKEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<En> i = new Queue<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((En)(c % 3));
            }
            Queue<En> o;
            Queue<En> r;

            r = p.opQEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<En> i = new Stack<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((En)(c % 3));
            }
            Stack<En> o;
            Stack<En> r;

            r = p.opSEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CEnS i = new CEnS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add((En)(c % 3));
            }
            CEnS o;
            CEnS r;

            r = p.opCEnS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CVPrx[] i = new CVPrx[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()));
            }
            CVPrx[] o;
            CVPrx[] r;

            r = p.opACVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<CVPrx> i = new List<CVPrx>(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            List<CVPrx> o;
            List<CVPrx> r;

            r = p.opLCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            LinkedList<CVPrx> i = new LinkedList<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            LinkedList<CVPrx> o;
            LinkedList<CVPrx> r;

            r = p.opKCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Queue<CVPrx> i = new Queue<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            Queue<CVPrx> o;
            Queue<CVPrx> r;

            r = p.opQCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Stack<CVPrx> i = new Stack<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            Stack<CVPrx> o;
            Stack<CVPrx> r;

            r = p.opSCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CCVPrxS i = new CCVPrxS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            CCVPrxS o;
            CCVPrxS r;

            r = p.opCCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Custom<int> i = new Custom<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c);
            }
            Custom<int> o;
            Custom<int> r;

            r = p.opCustomIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Custom<CV> i = new Custom<CV>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            i.Add(null);
            Custom<CV> o;
            Custom<CV> r;

            r = p.opCustomCVS(i, out o);

            IEnumerator<CV> eo = (IEnumerator<CV>)o.GetEnumerator();
            IEnumerator<CV> er = (IEnumerator<CV>)r.GetEnumerator();
            foreach(CV obj in i)
            {
                eo.MoveNext();
                er.MoveNext();
                if(obj == null)
                {
                    test(eo.Current == null);
                    test(er.Current == null);
                }
                else
                {
                    test(obj.i == eo.Current.i);
                    test(obj.i == er.Current.i);
                }
            }
        }

        {
            Custom<Custom<int>> i = new Custom<Custom<int>>();
            for(int c = 0; c < _length; ++c)
            {
                Custom<int> inner = new Custom<int>();
                for(int j = 0; j < c; ++j)
                {
                    inner.Add(j);
                }
                i.Add(inner);
            }
            Custom<Custom<int>> o;
            Custom<Custom<int>> r;

            r = p.opCustomIntSS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Custom<Custom<CV>> i = new Custom<Custom<CV>>();
            for(int c = 0; c < _length; ++c)
            {
                Custom<CV> inner = new Custom<CV>();
                for(int j = 0; j < c; ++j)
                {
                    inner.Add(new CV(j));
                }
                i.Add(inner);
            }
            Custom<Custom<CV>> o;
            Custom<Custom<CV>> r;

            r = p.opCustomCVSS(i, out o);

            IEnumerator<Custom<CV>> eo = (IEnumerator<Custom<CV>>)o.GetEnumerator();
            IEnumerator<Custom<CV>> er = (IEnumerator<Custom<CV>>)r.GetEnumerator();
            foreach(Custom<CV> s in i)
            {
                eo.MoveNext();
                er.MoveNext();
                IEnumerator<CV> io = (IEnumerator<CV>)eo.Current.GetEnumerator();
                IEnumerator<CV> ir = (IEnumerator<CV>)er.Current.GetEnumerator();
                foreach(CV obj in s)
                {
                    io.MoveNext();
                    ir.MoveNext();
                    if(obj == null)
                    {
                        test(io.Current == null);
                        test(ir.Current == null);
                    }
                    else
                    {
                        test(obj.i == io.Current.i);
                        test(obj.i == ir.Current.i);
                    }
                }
            }
        }

#if !COMPACT && !SILVERLIGHT
        {
            Serialize.Small i = null;
            Serialize.Small o;
            Serialize.Small r;

            r = p.opSerialSmallCSharp(i, out o);

            test(o == null);
            test(r == null);
        }

        {
            Serialize.Small i = new Serialize.Small();
            i.i = 99;
            Serialize.Small o;
            Serialize.Small r;

            try
            {
                r = p.opSerialSmallCSharp(i, out o);

                test(o.i == 99);
                test(r.i == 99);
            }
            catch(Ice.OperationNotExistException)
            {
                // OK, talking to non-C# server.
            }
        }

        {
            Serialize.Large i = new Serialize.Large();
            i.d1 = 1.0;
            i.d2 = 2.0;
            i.d3 = 3.0;
            i.d4 = 4.0;
            i.d5 = 5.0;
            i.d6 = 6.0;
            i.d7 = 7.0;
            i.d8 = 8.0;
            i.d9 = 9.0;
            i.d10 = 10.0;
            Serialize.Large o;
            Serialize.Large r;

            try
            {
                r = p.opSerialLargeCSharp(i, out o);

                test(o.d1 == 1.0);
                test(o.d2 == 2.0);
                test(o.d3 == 3.0);
                test(o.d4 == 4.0);
                test(o.d5 == 5.0);
                test(o.d6 == 6.0);
                test(o.d7 == 7.0);
                test(o.d8 == 8.0);
                test(o.d9 == 9.0);
                test(o.d10 == 10.0);
                test(r.d1 == 1.0);
                test(r.d2 == 2.0);
                test(r.d3 == 3.0);
                test(r.d4 == 4.0);
                test(r.d5 == 5.0);
                test(r.d6 == 6.0);
                test(r.d7 == 7.0);
                test(r.d8 == 8.0);
                test(r.d9 == 9.0);
                test(r.d10 == 10.0);
            }
            catch(Ice.OperationNotExistException)
            {
                // OK, talking to non-C# server.
            }
        }

        {
            Serialize.Struct i = new Serialize.Struct();
            i.o = null;
            i.o2 = i;
            i.s = null;
            i.s2 = "Hello";
            Serialize.Struct o;
            Serialize.Struct r;

            try
            {
                r = p.opSerialStructCSharp(i, out o);

                test(o.o == null);
                test(o.o2 != null);
                test(((Serialize.Struct)(o.o2)).o == null);
                test(((Serialize.Struct)(o.o2)).o2 == o.o2);
                test(o.s == null);
                test(o.s2.Equals("Hello"));
                test(r.o == null);
                test(r.o2 != null);
                test(((Serialize.Struct)(r.o2)).o == null);
                test(((Serialize.Struct)(r.o2)).o2 == r.o2);
                test(r.s == null);
                test(r.s2.Equals("Hello"));
            }
            catch(Ice.OperationNotExistException)
            {
                // OK, talking to non-C# server.
            }
        }
#endif
    }
Ejemplo n.º 52
0
        /// <summary>
        /// This will be called by CompletelyOptional modmanager.
        /// You don't need to worry about managing config.
        /// </summary>
        public bool LoadConfig()
        {
            config    = new Dictionary <string, string>();
            rawConfig = "Unconfiguable";
            if (!directory.Exists)
            {
                directory.Create(); return(false);
            }

            string path = string.Concat(new object[] {
                directory.FullName,
                "config.txt"
            });

            if (File.Exists(path))
            {
                try
                {
                    string txt = File.ReadAllText(path, Encoding.UTF8);
                    string key = txt.Substring(0, 32);
                    txt = txt.Substring(32, txt.Length - 32);
                    if (Custom.Md5Sum(txt) != key)
                    {
                        Debug.Log(string.Concat(mod.ModID, " config file has been tinkered! Load Default Config instead."));
                        return(false);
                    }

                    this.rawConfig = Crypto.DecryptString(txt, string.Concat("OptionalConfig " + mod.ModID));
                }
                catch
                {
                    Debug.Log(new LoadDataException(string.Concat(mod.ModID, " config file has been corrupted! Load Default Config instead.")));
                    return(false);
                }
            }
            else
            {
                //load default config from dictionary and save.
                return(false);
            }

            //Set Initialized stuff to new value
            Dictionary <string, string> loadedConfig = new Dictionary <string, string>();

            //convert to dictionary
            //<CfgC>key<CfgB><CfgD>value<CfgA>
            string[] array = Regex.Split(this.rawConfig, "<CfgA>");

            for (int i = 0; i < array.Length; i++)
            { //<CfgC>key<CfgB><CfgD>value
                string   key    = string.Empty;
                string   value  = string.Empty;
                string[] array2 = Regex.Split(array[i], "<CfgB>");
                for (int j = 0; j < array2.Length; j++)
                { //<CfgC>key || <CfgD>value
                    if (array2[j].Length < 6)
                    {
                        continue;
                    }
                    if (array2[j].Substring(0, 6) == "<CfgC>")
                    {
                        key = array2[j].Substring(6, array2[j].Length - 6);
                    }
                    else if (array2[j].Substring(0, 6) == "<CfgD>")
                    {
                        value = array2[j].Substring(6, array2[j].Length - 6);
                    }
                }
                if (string.IsNullOrEmpty(key))
                { //?!?!
                    continue;
                }
                loadedConfig.Add(key, value);
            }

            config = loadedConfig;

            try
            {
                ConfigOnChange();
            }
            catch (Exception e)
            {
                Debug.Log("CompletelyOptional: Lost backward capability in Config! Reset Config.");
                Debug.Log(new LoadDataException(e.ToString()));
                File.Delete(path);
                config    = new Dictionary <string, string>();
                rawConfig = "Unconfiguable";
                return(false);
            }
            return(true);
        }
Ejemplo n.º 53
0
 public override void opCustomCVSS_async(AMD_MyClass_opCustomCVSS cb, Custom<Custom<CV>> i, Ice.Current current)
 {
     cb.ice_response(i, i);
 }
Ejemplo n.º 54
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);

            Vector2 a, a2;

            if (subtleSlider)
            {
                float t = (this.valueInt - this.min) * this.mul;
                a   = new Vector2(this.pos.x + t, this.pos.y + 12f);
                a2  = new Vector2(24f, 24f);
                a  -= this.flash * new Vector2(8f, 8f);
                a2 += this.flash * new Vector2(16f, 16f);
            }
            else
            {
                a   = this.rect.DrawPos(dt);
                a2  = this.rect.DrawSize(dt);
                a  -= Vector2.Lerp(this.rect.lastAddSize, this.rect.addSize, dt) / 2f;
                a2 += Vector2.Lerp(this.rect.lastAddSize, this.rect.addSize, dt);
            }
            a.x  = Mathf.Floor(a.x) + 0.01f;
            a.y  = Mathf.Floor(a.y) + 0.01f;
            a2.x = Mathf.Round(a2.x) + 0.01f;
            a2.y = Mathf.Round(a2.y) + 0.01f;
            a   -= this.pos; a2 -= this.pos;
            float p = this.mul * (this.valueInt - this.min);

            if (!vertical)
            {
                this.lineSprites[1].x         = 0f;
                this.lineSprites[1].y         = 15f;
                this.lineSprites[1].isVisible = (a.x > 0f);
                this.lineSprites[1].scaleX    = a.x;
                this.lineSprites[2].x         = this.size.x;
                this.lineSprites[2].y         = 15f;
                this.lineSprites[2].isVisible = (a.x + a2.x < this.size.x + 12f);
                this.lineSprites[2].scaleX    = this.size.x; // + 12f - (a.x + a2.x);
                this.lineSprites[0].x         = 0f;
                this.lineSprites[0].y         = 15f;
                this.lineSprites[0].isVisible = (a.x > 0f);
                this.lineSprites[3].x         = this.size.x; // + this.ExtraLengthAtEnd;
                this.lineSprites[3].y         = 15f;
                this.lineSprites[3].isVisible = (a.x + a2.x < this.size.x + 12f);
                if (!subtleSlider)
                {
                    this.rect.pos.x = this.pos.x + p - 8f;
                    this.label.pos  = new Vector2(this.rect.pos.x - 14f, this.rect.pos.y + 20f);
                }
            }
            else
            {
                this.lineSprites[1].y         = 0f;
                this.lineSprites[1].x         = 15f;
                this.lineSprites[1].isVisible = (a.y > 0f);
                this.lineSprites[1].scaleY    = a.y;
                this.lineSprites[2].y         = this.size.y;
                this.lineSprites[2].x         = 15f;
                this.lineSprites[2].isVisible = (a.y + a2.y < this.size.y + 12f);
                this.lineSprites[2].scaleY    = this.size.y;
                this.lineSprites[0].y         = 0f;
                this.lineSprites[0].x         = 15f;
                this.lineSprites[0].isVisible = (a.y > 0f);
                this.lineSprites[3].y         = this.size.y;
                this.lineSprites[3].x         = 15f;
                this.lineSprites[3].isVisible = (a.y + a2.y < this.size.y + 12f);
                if (!subtleSlider)
                {
                    this.rect.pos.y = this.pos.y + p - 8f;
                    this.label.pos  = new Vector2(this.rect.pos.x - 10f, this.rect.pos.y + 12f);
                }
            }

            if (this.greyedOut)
            {
                foreach (FSprite s in this.lineSprites)
                {
                    s.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey);
                }
                if (subtleSlider)
                {
                    return;
                }
                for (int r = 0; r < 9; r++)
                {
                    this.rect.sprites[r].color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.Black);
                }
                for (int r = 9; r < 17; r++)
                {
                    this.rect.sprites[r].color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey);
                }
                this.label.label.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey);
                if (this.MouseOver)
                {
                    this.label.label.alpha = Mathf.Min(0.5f, this.label.label.alpha + 0.05f);
                }
                else
                {
                    this.label.label.alpha = Mathf.Max(0f, this.label.label.alpha - 0.1f);
                }
                return;
            }

            this.flash    = Custom.LerpAndTick(this.flash, 0f, 0.01f, 0.166666672f);
            this.greyFade = Custom.LerpAndTick(this.greyFade, (!PolishedMachine.Config.ConfigMenu.freezeMenu || this.held) ? 0f : 1f, 0.05f, 0.025f);
            float num = 0.5f - 0.5f * Mathf.Sin(this.sin / 30f * 3.14159274f * 2f);

            num *= this.sizeBump;

            if (MouseOver || flashBool)
            {
                this.extraSizeBump = Mathf.Min(1f, this.extraSizeBump + 0.1f);
                this.sizeBump      = Custom.LerpAndTick(this.sizeBump, 1f, 0.1f, 0.1f);
                this.col           = Mathf.Min(1f, this.col + 0.1f);
                this.sin          += 1f;
                if (this.flashBool)
                {
                    this.flashBool = false;
                    this.flash     = Mathf.Min(1f, this.flash + 0.4f);
                }
                if (!subtleSlider)
                {
                    this.label.label.alpha = Mathf.Min(this.label.label.alpha + 0.1f, 1f);
                }
            }
            else
            {
                this.extraSizeBump = 0f;
                this.sizeBump      = Custom.LerpAndTick(this.sizeBump, 0f, 0.1f, 0.05f);
                this.col           = Mathf.Max(0f, this.col - 0.0333333351f);
                if (!this.held && !subtleSlider)
                {
                    this.label.label.alpha = Mathf.Max(this.label.label.alpha - 0.15f, 0f);
                }
            }

            this.flash = Mathf.Max(0f, this.flash - 0.142857149f);

            if (!subtleSlider)
            {
                this.rect.fillAlpha = Mathf.Lerp(0.3f, 0.6f, this.col);
                this.rect.addSize   = new Vector2(4f, 4f) * (this.sizeBump + 0.5f * Mathf.Sin(this.extraSizeBump * 3.14159274f));
            }

            Color color;
            float alpha = 0.5f + 0.5f * Mathf.Sin(this.sin / 30f * 3.14159274f * 2f);

            if (this.held)
            {
                if (!subtleSlider)
                {
                    color = Color.Lerp(Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey), num), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
                    for (int r = 0; r < 9; r++)
                    {
                        this.rect.sprites[r].color = color; this.rect.sprites[r].alpha = alpha;
                    }
                    color = Color.Lerp(color, Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
                    for (int r = 9; r < 17; r++)
                    {
                        this.rect.sprites[r].color = color;
                    }
                }
                color = Color.Lerp(Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey), num), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
            }
            else
            {
                if (!subtleSlider)
                {
                    color = Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), Mathf.Max(num, this.greyFade));
                    for (int r = 0; r < 9; r++)
                    {
                        this.rect.sprites[r].color = color; this.rect.sprites[r].alpha = alpha;
                    }
                    color = Color.Lerp(color, Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
                    for (int r = 9; r < 17; r++)
                    {
                        this.rect.sprites[r].color = color;
                    }
                }
                color = Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey), Mathf.Max(num, this.greyFade));
            }
            foreach (FSprite l in this.lineSprites)
            {
                l.color = color;
            }
            if (!subtleSlider)
            {
                this.label.label.color = Color.Lerp(this.rect.sprites[9].color, Menu.Menu.MenuColor(Menu.Menu.MenuColors.White).rgb, 0.5f);
            }
        }
Ejemplo n.º 55
0
 public AMI_MyClass_opCustomIntSSI(Custom<Custom<int>> i)
 {
     _i = i;
 }
Ejemplo n.º 56
0
 public void Update()
 {
     if (crit.pos != lastPos)
     {
         lastPos = crit.pos;
         if (!drag)
         {
             dragPos = drawPos;
         }
         drag = true;
     }
     drawPos = myMapPage.CreatureVisPos(crit.pos, crit.InDen, true);
     if (crit.realizedCreature == null && crit.distanceToMyNode < 0)
     {
         drawPos.y = drawPos.y + Mathf.Lerp(-2f, 2f, Random.value);
     }
     if (crit.InDen)
     {
         drawPos.y = drawPos.y - 10f;
     }
     sprite.x = drawPos.x;
     sprite.y = drawPos.y;
     if (drag)
     {
         dragPos        += Vector2.ClampMagnitude(drawPos - dragPos, 10f);
         sprite.scaleY   = Vector2.Distance(drawPos, dragPos);
         sprite.rotation = Custom.AimFromOneVectorToAnother(drawPos, dragPos);
         if (Custom.DistLess(dragPos, drawPos, 5f))
         {
             drag = false;
         }
     }
     else if (crit.pos.NodeDefined)
     {
         Vector2 vector = myMapPage.NodeVisPos(crit.pos.room, crit.pos.abstractNode);
         sprite.scaleY   = Vector2.Distance(drawPos, vector);
         sprite.rotation = Custom.AimFromOneVectorToAnother(drawPos, vector);
     }
     else
     {
         sprite.scaleY   = 10f;
         sprite.rotation = 135f;
     }
     if (crit.abstractAI != null)
     {
         Vector2 vector2 = myMapPage.CreatureVisPos(crit.abstractAI.destination, false, false);
         sprite2.x        = drawPos.x;
         sprite2.y        = drawPos.y;
         sprite2.color    = Color.Lerp(new Color(1f, 1f, 1f), label.color, Random.value);
         sprite2.scaleY   = Vector2.Distance(drawPos, vector2);
         sprite2.rotation = Custom.AimFromOneVectorToAnother(drawPos, vector2);
     }
     label.x      = drawPos.x;
     label.y      = drawPos.y;
     label.color  = CritCol(crit);
     sprite.color = label.color;
     label2.x     = drawPos.x + 1f;
     label2.y     = drawPos.y - 1f;
     label.text   = CritString(crit);
     label2.text  = label.text;
     if (crit.slatedForDeletion)
     {
         Destroy();
     }
 }
Ejemplo n.º 57
0
 public AMI_MyClass_opCustomCVSSI(Custom<Custom<CV>> i)
 {
     _i = i;
 }
Ejemplo n.º 58
0
        private void SpawnEntity(SandboxEditor.PlacedIconData placedIconData)
        {
            IconSymbol.IconSymbolData data = placedIconData.data;
            WorldCoordinate           pos  = new WorldCoordinate(0, -1, -1, -1);

            pos.x = Mathf.RoundToInt(placedIconData.pos.x / 20f);
            pos.y = Mathf.RoundToInt(placedIconData.pos.y / 20f);
            EntityID entityID = (!base.GameTypeSetup.saveCreatures) ? this.game.GetNewID() : placedIconData.ID;

            if (data.itemType == AbstractPhysicalObject.AbstractObjectType.Creature)
            {
                AbstractCreature abstractCreature = null;
                if (base.GameTypeSetup.saveCreatures)
                {
                    for (int i = 0; i < this.arenaSitting.creatures.Count; i++)
                    {
                        if (this.arenaSitting.creatures[i].creatureTemplate.type == data.critType && this.arenaSitting.creatures[i].ID == entityID)
                        {
                            abstractCreature = this.arenaSitting.creatures[i];
                            this.arenaSitting.creatures.RemoveAt(i);
                            for (int j = 0; j < 2; j++)
                            {
                                abstractCreature.state.CycleTick();
                            }
                            string creatureString = SaveState.AbstractCreatureToString(abstractCreature);
                            abstractCreature     = SaveState.AbstractCreatureFromString(this.game.world, creatureString, false);
                            abstractCreature.pos = pos;
                            break;
                        }
                    }
                }
                if (abstractCreature == null)
                {
                    abstractCreature = new AbstractCreature(this.game.world, StaticWorld.GetCreatureTemplate(data.critType), null, pos, entityID);
                }
                CreatureTemplate.Type critType = data.critType;
                switch (critType)
                {
                case CreatureTemplate.Type.TentaclePlant:
                case CreatureTemplate.Type.PoleMimic:
                    abstractCreature.pos.x            = -1;
                    abstractCreature.pos.y            = -1;
                    abstractCreature.pos.abstractNode = data.intData;
                    this.game.world.GetAbstractRoom(0).entitiesInDens.Add(abstractCreature);
                    break;

                default:
                    switch (critType)
                    {
                    case CreatureTemplate.Type.Fly:
                    case CreatureTemplate.Type.Leech:
                    case CreatureTemplate.Type.SeaLeech:
                        for (int k = 0; k < 5; k++)
                        {
                            this.game.world.GetAbstractRoom(0).AddEntity(new AbstractCreature(this.game.world, StaticWorld.GetCreatureTemplate(data.critType), null, pos, entityID));
                        }
                        break;

                    default:
                        if (critType == CreatureTemplate.Type.Slugcat)
                        {
                            if (this.playerSpawnDens == null)
                            {
                                this.playerSpawnDens = new List <int>();
                            }
                            this.playerSpawnDens.Add(data.intData);
                        }
                        if (critType != CreatureTemplate.Type.Spider)
                        {
                            this.game.world.GetAbstractRoom(0).AddEntity(abstractCreature);
                        }
                        break;
                    }
                    break;

                case CreatureTemplate.Type.Centipede:
                {
                    float num = 0f;
                    if (data.intData == 2)
                    {
                        num = Mathf.Lerp(0.265f, 0.55f, Mathf.Pow(Custom.ClampedRandomVariation(0.5f, 0.5f, 0.7f), 1.2f));
                    }
                    else if (data.intData == 3)
                    {
                        num = Mathf.Lerp(0.7f, 1f, Mathf.Pow(UnityEngine.Random.value, 0.6f));
                    }
                    abstractCreature.spawnData = "{" + num.ToString() + "}";
                    this.game.world.GetAbstractRoom(0).AddEntity(abstractCreature);
                    break;
                }
                }
            }
            else
            {
                AbstractPhysicalObject.AbstractObjectType itemType = data.itemType;
                if (itemType != AbstractPhysicalObject.AbstractObjectType.Spear)
                {
                    if (itemType != AbstractPhysicalObject.AbstractObjectType.WaterNut)
                    {
                        if (itemType != AbstractPhysicalObject.AbstractObjectType.SporePlant)
                        {
                            if (itemType != AbstractPhysicalObject.AbstractObjectType.BubbleGrass)
                            {
                                if (AbstractConsumable.IsTypeConsumable(data.itemType))
                                {
                                    this.game.world.GetAbstractRoom(0).AddEntity(new AbstractConsumable(this.game.world, data.itemType, null, pos, entityID, -1, -1, null));
                                }
                                else
                                {
                                    this.game.world.GetAbstractRoom(0).AddEntity(new AbstractPhysicalObject(this.game.world, data.itemType, null, pos, entityID));
                                }
                            }
                            else
                            {
                                this.game.world.GetAbstractRoom(0).AddEntity(new BubbleGrass.AbstractBubbleGrass(this.game.world, null, pos, entityID, 1f, -1, -1, null));
                            }
                        }
                        else
                        {
                            this.game.world.GetAbstractRoom(0).AddEntity(new SporePlant.AbstractSporePlant(this.game.world, null, pos, entityID, -1, -1, null, false, true));
                        }
                    }
                    else
                    {
                        this.game.world.GetAbstractRoom(0).AddEntity(new WaterNut.AbstractWaterNut(this.game.world, null, pos, entityID, -1, -1, null, false));
                    }
                }
                else
                {
                    this.game.world.GetAbstractRoom(0).AddEntity(new AbstractSpear(this.game.world, null, pos, entityID, data.intData == 1));
                }
            }
        }
Ejemplo n.º 59
0
    internal static void twowaysAMI(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            byte[] i = new byte[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (byte)c;
            }

            AMI_MyClass_opAByteSI cb = new AMI_MyClass_opAByteSI(i);
            p.opAByteS_async(cb, i);
            cb.check();
        }

        {
            List<byte> i = new List<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((byte)c);
            }

            AMI_MyClass_opLByteSI cb = new AMI_MyClass_opLByteSI(i);
            p.opLByteS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<byte> i = new LinkedList<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((byte)c);
            }

            AMI_MyClass_opKByteSI cb = new AMI_MyClass_opKByteSI(i);
            p.opKByteS_async(cb, i);
            cb.check();
        }

        {
            Queue<byte> i = new Queue<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((byte)c);
            }

            AMI_MyClass_opQByteSI cb = new AMI_MyClass_opQByteSI(i);
            p.opQByteS_async(cb, i);
            cb.check();
        }

        {
            Stack<byte> i = new Stack<byte>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((byte)c);
            }

            AMI_MyClass_opSByteSI cb = new AMI_MyClass_opSByteSI(i);
            p.opSByteS_async(cb, i);
            cb.check();
        }

        {
            CByteS i = new CByteS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((byte)c);
            }

            AMI_MyClass_opCByteSI cb = new AMI_MyClass_opCByteSI(i);
            p.opCByteS_async(cb, i);
            cb.check();
        }

        {
            bool[] i = new bool[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = c % 1 == 1;
            }

            AMI_MyClass_opABoolSI cb = new AMI_MyClass_opABoolSI(i);
            p.opABoolS_async(cb, i);
            cb.check();
        }

        {
            List<bool> i = new List<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c % 1 == 1);
            }

            AMI_MyClass_opLBoolSI cb = new AMI_MyClass_opLBoolSI(i);
            p.opLBoolS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<bool> i = new LinkedList<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(c % 1 == 1);
            }

            AMI_MyClass_opKBoolSI cb = new AMI_MyClass_opKBoolSI(i);
            p.opKBoolS_async(cb, i);
            cb.check();
        }

        {
            Queue<bool> i = new Queue<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(c % 1 == 1);
            }

            AMI_MyClass_opQBoolSI cb = new AMI_MyClass_opQBoolSI(i);
            p.opQBoolS_async(cb, i);
            cb.check();
        }

        {
            Stack<bool> i = new Stack<bool>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(c % 1 == 1);
            }

            AMI_MyClass_opSBoolSI cb = new AMI_MyClass_opSBoolSI(i);
            p.opSBoolS_async(cb, i);
            cb.check();
        }

        {
            CBoolS i = new CBoolS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c % 1 == 1);
            }

            AMI_MyClass_opCBoolSI cb = new AMI_MyClass_opCBoolSI(i);
            p.opCBoolS_async(cb, i);
            cb.check();
        }

        {
            short[] i = new short[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (short)c;
            }

            AMI_MyClass_opAShortSI cb = new AMI_MyClass_opAShortSI(i);
            p.opAShortS_async(cb, i);
            cb.check();
        }

        {
            List<short> i = new List<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((short)c);
            }

            AMI_MyClass_opLShortSI cb = new AMI_MyClass_opLShortSI(i);
            p.opLShortS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<short> i = new LinkedList<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((short)c);
            }

            AMI_MyClass_opKShortSI cb = new AMI_MyClass_opKShortSI(i);
            p.opKShortS_async(cb, i);
            cb.check();
        }

        {
            Queue<short> i = new Queue<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((short)c);
            }

            AMI_MyClass_opQShortSI cb = new AMI_MyClass_opQShortSI(i);
            p.opQShortS_async(cb, i);
            cb.check();
        }

        {
            Stack<short> i = new Stack<short>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((short)c);
            }

            AMI_MyClass_opSShortSI cb = new AMI_MyClass_opSShortSI(i);
            p.opSShortS_async(cb, i);
            cb.check();
        }

        {
            CShortS i = new CShortS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((short)c);
            }

            AMI_MyClass_opCShortSI cb = new AMI_MyClass_opCShortSI(i);
            p.opCShortS_async(cb, i);
            cb.check();
        }

        {
            int[] i = new int[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (int)c;
            }

            AMI_MyClass_opAIntSI cb = new AMI_MyClass_opAIntSI(i);
            p.opAIntS_async(cb, i);
            cb.check();
        }

        {
            List<int> i = new List<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((int)c);
            }

            AMI_MyClass_opLIntSI cb = new AMI_MyClass_opLIntSI(i);
            p.opLIntS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<int> i = new LinkedList<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((int)c);
            }

            AMI_MyClass_opKIntSI cb = new AMI_MyClass_opKIntSI(i);
            p.opKIntS_async(cb, i);
            cb.check();
        }

        {
            Queue<int> i = new Queue<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((int)c);
            }

            AMI_MyClass_opQIntSI cb = new AMI_MyClass_opQIntSI(i);
            p.opQIntS_async(cb, i);
            cb.check();
        }

        {
            Stack<int> i = new Stack<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((int)c);
            }

            AMI_MyClass_opSIntSI cb = new AMI_MyClass_opSIntSI(i);
            p.opSIntS_async(cb, i);
            cb.check();
        }

        {
            CIntS i = new CIntS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((int)c);
            }

            AMI_MyClass_opCIntSI cb = new AMI_MyClass_opCIntSI(i);
            p.opCIntS_async(cb, i);
            cb.check();
        }

        {
            long[] i = new long[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (long)c;
            }

            AMI_MyClass_opALongSI cb = new AMI_MyClass_opALongSI(i);
            p.opALongS_async(cb, i);
            cb.check();
        }

        {
            List<long> i = new List<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((long)c);
            }

            AMI_MyClass_opLLongSI cb = new AMI_MyClass_opLLongSI(i);
            p.opLLongS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<long> i = new LinkedList<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((long)c);
            }

            AMI_MyClass_opKLongSI cb = new AMI_MyClass_opKLongSI(i);
            p.opKLongS_async(cb, i);
            cb.check();
        }

        {
            Queue<long> i = new Queue<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((long)c);
            }

            AMI_MyClass_opQLongSI cb = new AMI_MyClass_opQLongSI(i);
            p.opQLongS_async(cb, i);
            cb.check();
        }

        {
            Stack<long> i = new Stack<long>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((long)c);
            }

            AMI_MyClass_opSLongSI cb = new AMI_MyClass_opSLongSI(i);
            p.opSLongS_async(cb, i);
            cb.check();
        }

        {
            CLongS i = new CLongS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((long)c);
            }

            AMI_MyClass_opCLongSI cb = new AMI_MyClass_opCLongSI(i);
            p.opCLongS_async(cb, i);
            cb.check();
        }

        {
            float[] i = new float[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (float)c;
            }

            AMI_MyClass_opAFloatSI cb = new AMI_MyClass_opAFloatSI(i);
            p.opAFloatS_async(cb, i);
            cb.check();
        }

        {
            List<float> i = new List<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((float)c);
            }

            AMI_MyClass_opLFloatSI cb = new AMI_MyClass_opLFloatSI(i);
            p.opLFloatS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<float> i = new LinkedList<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((float)c);
            }

            AMI_MyClass_opKFloatSI cb = new AMI_MyClass_opKFloatSI(i);
            p.opKFloatS_async(cb, i);
            cb.check();
        }

        {
            Queue<float> i = new Queue<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((float)c);
            }

            AMI_MyClass_opQFloatSI cb = new AMI_MyClass_opQFloatSI(i);
            p.opQFloatS_async(cb, i);
            cb.check();
        }

        {
            Stack<float> i = new Stack<float>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((float)c);
            }

            AMI_MyClass_opSFloatSI cb = new AMI_MyClass_opSFloatSI(i);
            p.opSFloatS_async(cb, i);
            cb.check();
        }

        {
            CFloatS i = new CFloatS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((float)c);
            }

            AMI_MyClass_opCFloatSI cb = new AMI_MyClass_opCFloatSI(i);
            p.opCFloatS_async(cb, i);
            cb.check();
        }

        {
            double[] i = new double[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (double)c;
            }

            AMI_MyClass_opADoubleSI cb = new AMI_MyClass_opADoubleSI(i);
            p.opADoubleS_async(cb, i);
            cb.check();
        }

        {
            List<double> i = new List<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((double)c);
            }

            AMI_MyClass_opLDoubleSI cb = new AMI_MyClass_opLDoubleSI(i);
            p.opLDoubleS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<double> i = new LinkedList<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((double)c);
            }

            AMI_MyClass_opKDoubleSI cb = new AMI_MyClass_opKDoubleSI(i);
            p.opKDoubleS_async(cb, i);
            cb.check();
        }

        {
            Queue<double> i = new Queue<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((double)c);
            }

            AMI_MyClass_opQDoubleSI cb = new AMI_MyClass_opQDoubleSI(i);
            p.opQDoubleS_async(cb, i);
            cb.check();
        }

        {
            Stack<double> i = new Stack<double>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((double)c);
            }

            AMI_MyClass_opSDoubleSI cb = new AMI_MyClass_opSDoubleSI(i);
            p.opSDoubleS_async(cb, i);
            cb.check();
        }

        {
            CDoubleS i = new CDoubleS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((double)c);
            }

            AMI_MyClass_opCDoubleSI cb = new AMI_MyClass_opCDoubleSI(i);
            p.opCDoubleS_async(cb, i);
            cb.check();
        }

        {
            string[] i = new string[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = c.ToString();
            }

            AMI_MyClass_opAStringSI cb = new AMI_MyClass_opAStringSI(i);
            p.opAStringS_async(cb, i);
            cb.check();
        }

        {
            List<string> i = new List<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c.ToString());
            }

            AMI_MyClass_opLStringSI cb = new AMI_MyClass_opLStringSI(i);
            p.opLStringS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<string> i = new LinkedList<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(c.ToString());
            }

            AMI_MyClass_opKStringSI cb = new AMI_MyClass_opKStringSI(i);
            p.opKStringS_async(cb, i);
            cb.check();
        }

        {
            Queue<string> i = new Queue<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(c.ToString());
            }

            AMI_MyClass_opQStringSI cb = new AMI_MyClass_opQStringSI(i);
            p.opQStringS_async(cb, i);
            cb.check();
        }

        {
            Stack<string> i = new Stack<string>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(c.ToString());
            }

            AMI_MyClass_opSStringSI cb = new AMI_MyClass_opSStringSI(i);
            p.opSStringS_async(cb, i);
            cb.check();
        }

        {
            CStringS i = new CStringS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c.ToString());
            }

            AMI_MyClass_opCStringSI cb = new AMI_MyClass_opCStringSI(i);
            p.opCStringS_async(cb, i);
            cb.check();
        }

        {
            Ice.Object[] i = new Ice.Object[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CV(c);
            }

            AMI_MyClass_opAObjectSI cb = new AMI_MyClass_opAObjectSI(i);
            p.opAObjectS_async(cb, i);
            cb.check();
        }

        {
            List<Ice.Object> i = new List<Ice.Object>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }

            AMI_MyClass_opLObjectSI cb = new AMI_MyClass_opLObjectSI(i);
            p.opLObjectS_async(cb, i);
            cb.check();
        }

        {
            CObjectS i = new CObjectS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }

            AMI_MyClass_opCObjectSI cb = new AMI_MyClass_opCObjectSI(i);
            p.opCObjectS_async(cb, i);
            cb.check();
        }

        {
            Ice.ObjectPrx[] i = new Ice.ObjectPrx[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = communicator.stringToProxy(c.ToString());
            }

            AMI_MyClass_opAObjectPrxSI cb = new AMI_MyClass_opAObjectPrxSI(i);
            p.opAObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            List<Ice.ObjectPrx> i = new List<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opLObjectPrxSI cb = new AMI_MyClass_opLObjectPrxSI(i);
            p.opLObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<Ice.ObjectPrx> i = new LinkedList<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opKObjectPrxSI cb = new AMI_MyClass_opKObjectPrxSI(i);
            p.opKObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            Queue<Ice.ObjectPrx> i = new Queue<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opQObjectPrxSI cb = new AMI_MyClass_opQObjectPrxSI(i);
            p.opQObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            Stack<Ice.ObjectPrx> i = new Stack<Ice.ObjectPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opSObjectPrxSI cb = new AMI_MyClass_opSObjectPrxSI(i);
            p.opSObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            CObjectPrxS i = new CObjectPrxS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opCObjectPrxSI cb = new AMI_MyClass_opCObjectPrxSI(i);
            p.opCObjectPrxS_async(cb, i);
            cb.check();
        }

        {
            S[] i = new S[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c].i = c;
            }

            AMI_MyClass_opAStructSI cb = new AMI_MyClass_opAStructSI(i);
            p.opAStructS_async(cb, i);
            cb.check();
        }

        {
            List<S> i = new List<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new S(c));
            }

            AMI_MyClass_opLStructSI cb = new AMI_MyClass_opLStructSI(i);
            p.opLStructS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<S> i = new LinkedList<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(new S(c));
            }

            AMI_MyClass_opKStructSI cb = new AMI_MyClass_opKStructSI(i);
            p.opKStructS_async(cb, i);
            cb.check();
        }

        {
            Queue<S> i = new Queue<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(new S(c));
            }

            AMI_MyClass_opQStructSI cb = new AMI_MyClass_opQStructSI(i);
            p.opQStructS_async(cb, i);
            cb.check();
        }

        {
            Stack<S> i = new Stack<S>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(new S(c));
            }

            AMI_MyClass_opSStructSI cb = new AMI_MyClass_opSStructSI(i);
            p.opSStructS_async(cb, i);
            cb.check();
        }

        {
            CStructS i = new CStructS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new S(c));
            }

            AMI_MyClass_opCStructSI cb = new AMI_MyClass_opCStructSI(i);
            p.opCStructS_async(cb, i);
            cb.check();
        }

        {
            SD[] i = new SD[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new SD(c);
            }

            AMI_MyClass_opAStructSDI cb = new AMI_MyClass_opAStructSDI(i);
            p.opAStructSD_async(cb, i);
            cb.check();
        }

        {
            List<SD> i = new List<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new SD(c));
            }

            AMI_MyClass_opLStructSDI cb = new AMI_MyClass_opLStructSDI(i);
            p.opLStructSD_async(cb, i);
            cb.check();
        }

        {
            LinkedList<SD> i = new LinkedList<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(new SD(c));
            }

            AMI_MyClass_opKStructSDI cb = new AMI_MyClass_opKStructSDI(i);
            p.opKStructSD_async(cb, i);
            cb.check();
        }

        {
            Queue<SD> i = new Queue<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(new SD(c));
            }

            AMI_MyClass_opQStructSDI cb = new AMI_MyClass_opQStructSDI(i);
            p.opQStructSD_async(cb, i);
            cb.check();
        }

        {
            Stack<SD> i = new Stack<SD>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(new SD(c));
            }

            AMI_MyClass_opSStructSDI cb = new AMI_MyClass_opSStructSDI(i);
            p.opSStructSD_async(cb, i);
            cb.check();
        }

        {
            CStructSD i = new CStructSD();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new SD(c));
            }

            AMI_MyClass_opCStructSDI cb = new AMI_MyClass_opCStructSDI(i);
            p.opCStructSD_async(cb, i);
            cb.check();
        }

        {
            CV[] i = new CV[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CV(c);
            }

            AMI_MyClass_opACVSI cb = new AMI_MyClass_opACVSI(i);
            p.opACVS_async(cb, i);
            cb.check();
        }

        {
            List<CV> i = new List<CV>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }

            AMI_MyClass_opLCVSI cb = new AMI_MyClass_opLCVSI(i);
            p.opLCVS_async(cb, i);
            cb.check();
        }

        {
            CCVS i = new CCVS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }

            AMI_MyClass_opCCVSI cb = new AMI_MyClass_opCCVSI(i);
            p.opCCVS_async(cb, i);
            cb.check();
        }

        {
            CVPrx[] i = new CVPrx[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()));
            }

            AMI_MyClass_opACVPrxSI cb = new AMI_MyClass_opACVPrxSI(i);
            p.opACVPrxS_async(cb, i);
            cb.check();
        }

        {
            List<CVPrx> i = new List<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }

            AMI_MyClass_opLCVPrxSI cb = new AMI_MyClass_opLCVPrxSI(i);
            p.opLCVPrxS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<CVPrx> i = new LinkedList<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }

            AMI_MyClass_opKCVPrxSI cb = new AMI_MyClass_opKCVPrxSI(i);
            p.opKCVPrxS_async(cb, i);
            cb.check();
        }

        {
            Queue<CVPrx> i = new Queue<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }

            AMI_MyClass_opQCVPrxSI cb = new AMI_MyClass_opQCVPrxSI(i);
            p.opQCVPrxS_async(cb, i);
            cb.check();
        }

        {
            Stack<CVPrx> i = new Stack<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }

            AMI_MyClass_opSCVPrxSI cb = new AMI_MyClass_opSCVPrxSI(i);
            p.opSCVPrxS_async(cb, i);
            cb.check();
        }

        {
            CCVPrxS i = new CCVPrxS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }

            AMI_MyClass_opCCVPrxSI cb = new AMI_MyClass_opCCVPrxSI(i);
            p.opCCVPrxS_async(cb, i);
            cb.check();
        }

        {
            CR[] i = new CR[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = new CR(new CV(c));
            }

            AMI_MyClass_opACRSI cb = new AMI_MyClass_opACRSI(i);
            p.opACRS_async(cb, i);
            cb.check();
        }

        {
            List<CR> i = new List<CR>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CR(new CV(c)));
            }

            AMI_MyClass_opLCRSI cb = new AMI_MyClass_opLCRSI(i);
            p.opLCRS_async(cb, i);
            cb.check();
        }

        {
            CCRS i = new CCRS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CR(new CV(c)));
            }

            AMI_MyClass_opCCRSI cb = new AMI_MyClass_opCCRSI(i);
            p.opCCRS_async(cb, i);
            cb.check();
        }

        {
            En[] i = new En[_length];
            for(int c = 0; c < _length; ++c)
            {
                i[c] = (En)(c % 3);
            }

            AMI_MyClass_opAEnSI cb = new AMI_MyClass_opAEnSI(i);
            p.opAEnS_async(cb, i);
            cb.check();
        }

        {
            List<En> i = new List<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((En)(c % 3));
            }

            AMI_MyClass_opLEnSI cb = new AMI_MyClass_opLEnSI(i);
            p.opLEnS_async(cb, i);
            cb.check();
        }

        {
            LinkedList<En> i = new LinkedList<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.AddLast((En)(c % 3));
            }

            AMI_MyClass_opKEnSI cb = new AMI_MyClass_opKEnSI(i);
            p.opKEnS_async(cb, i);
            cb.check();
        }

        {
            Queue<En> i = new Queue<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.Enqueue((En)(c % 3));
            }

            AMI_MyClass_opQEnSI cb = new AMI_MyClass_opQEnSI(i);
            p.opQEnS_async(cb, i);
            cb.check();
        }

        {
            Stack<En> i = new Stack<En>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push((En)(c % 3));
            }

            AMI_MyClass_opSEnSI cb = new AMI_MyClass_opSEnSI(i);
            p.opSEnS_async(cb, i);
            cb.check();
        }

        {
            CEnS i = new CEnS();
            for(int c = 0; c < _length; ++c)
            {
                i.Add((En)(c % 3));
            }

            AMI_MyClass_opCEnSI cb = new AMI_MyClass_opCEnSI(i);
            p.opCEnS_async(cb, i);
            cb.check();
        }

        {
            Custom<int> i = new Custom<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c);
            }

            AMI_MyClass_opCustomIntSI cb = new AMI_MyClass_opCustomIntSI(i);
            p.opCustomIntS_async(cb, i);
            cb.check();
        }

        {
            Custom<CV> i = new Custom<CV>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }

            AMI_MyClass_opCustomCVSI cb = new AMI_MyClass_opCustomCVSI(i);
            p.opCustomCVS_async(cb, i);
            cb.check();
        }

        {
            Custom<Custom<int>> i = new Custom<Custom<int>>();
            for(int c = 0; c < _length; ++c)
            {
                Custom<int> inner = new Custom<int>();
                for(int j = 0; j < c; ++j)
                {
                    inner.Add(j);
                }
                i.Add(inner);
            }

            AMI_MyClass_opCustomIntSSI cb = new AMI_MyClass_opCustomIntSSI(i);
            p.opCustomIntSS_async(cb, i);
            cb.check();
        }

        {
            Custom<Custom<CV>> i = new Custom<Custom<CV>>();
            for(int c = 0; c < _length; ++c)
            {
                Custom<CV> inner = new Custom<CV>();
                for(int j = 0; j < c; ++j)
                {
                    inner.Add(new CV(j));
                }
                i.Add(inner);
            }

            AMI_MyClass_opCustomCVSSI cb = new AMI_MyClass_opCustomCVSSI(i);
            p.opCustomCVSS_async(cb, i);
            cb.check();
        }

#if !COMPACT && !SILVERLIGHT
        {
            Serialize.Small i = null;

            AMI_MyClass_opSerialSmallCSharpNull cb = new AMI_MyClass_opSerialSmallCSharpNull();
            p.opSerialSmallCSharp_async(cb, i);
            cb.check();
        }

        {
            Serialize.Small i = new Serialize.Small();
            i.i = 99;

            AMI_MyClass_opSerialSmallCSharp cb = new AMI_MyClass_opSerialSmallCSharp();
            p.opSerialSmallCSharp_async(cb, i);
            cb.check();
        }

        {
            Serialize.Large i = new Serialize.Large();
            i.d1 = 1.0;
            i.d2 = 2.0;
            i.d3 = 3.0;
            i.d4 = 4.0;
            i.d5 = 5.0;
            i.d6 = 6.0;
            i.d7 = 7.0;
            i.d8 = 8.0;
            i.d9 = 9.0;
            i.d10 = 10.0;

            AMI_MyClass_opSerialLargeCSharp cb = new AMI_MyClass_opSerialLargeCSharp();
            p.opSerialLargeCSharp_async(cb, i);
            cb.check();
        }

        {
            Serialize.Struct i = new Serialize.Struct();
            i.o = null;
            i.o2 = i;
            i.s = null;
            i.s2 = "Hello";

            AMI_MyClass_opSerialStructCSharp cb = new AMI_MyClass_opSerialStructCSharp();
            p.opSerialStructCSharp_async(cb, i);
            cb.check();
        }
#endif
    }
Ejemplo n.º 60
0
        public override void Update(bool eu)
        {
            base.Update(eu);

            lastScreenblockAlpha = screenblockAlpha;

            hideAllSprites = false;
            if (room.game.IsArenaSession)
            {
                if (!room.game.GetArenaGameSession.playersSpawned)
                {
                    hideAllSprites = true;
                }
            }

            Player ply = null;

            if (room.game.Players.Count > 0)
            {
                ply = room.game.Players[0].realizedCreature as Player;
            }

            // Map edges to display quads
            if (state != MappingState.Done)
            {
                UpdateMapper(300);
            }

            // Do not try to access shortcuts when the room is not ready for AI
            if (!room.readyForAI)
            {
                screenblockAlpha = 1f;
                return;
            }

            // Find the player's shortcut vessel
            ShortcutHandler.ShortCutVessel plyVessel = null;
            foreach (ShortcutHandler.ShortCutVessel vessel in room.game.shortcuts.transportVessels)
            {
                if (vessel.creature == ply)
                {
                    plyVessel = vessel;
                    break;
                }
            }

            if (ply == null || ply.room != room || (plyVessel != null && plyVessel.entranceNode != -1))
            {
                screenblockAlpha = Mathf.Clamp01(screenblockAlpha + 0.1f);
            }
            else
            {
                screenblockAlpha = Mathf.Clamp01(screenblockAlpha - 0.1f);
            }

            if (ply != null)
            {
                // Search for the closest shortcut entrance and display a sprite at the end location
                // Disabled in classic mode
                if (!LineOfSightMod.classic)
                {
                    IntVector2 scPos = new IntVector2();
                    bool       found = false;
                    if (ply.room != null && !ply.inShortcut)
                    {
                        for (int chunk = 0; chunk < ply.bodyChunks.Length; chunk++)
                        {
                            IntVector2 chunkPos = room.GetTilePosition(ply.bodyChunks[chunk].pos);
                            for (int i = 0; i < _peekSearchOffsets.Length; i++)
                            {
                                IntVector2 testPos = chunkPos + _peekSearchOffsets[i];
                                if (testPos.x < 0 || testPos.y < 0 || testPos.x >= room.TileWidth || testPos.y >= room.TileHeight)
                                {
                                    continue;
                                }
                                if (room.GetTile(testPos).Terrain == Room.Tile.TerrainType.ShortcutEntrance)
                                {
                                    int ind = Array.IndexOf(room.shortcutsIndex, testPos);
                                    if (ind > -1 && ind < (room.shortcuts?.Length ?? 0))
                                    {
                                        if (room.shortcuts[ind].shortCutType == ShortcutData.Type.Normal)
                                        {
                                            found = true;
                                            scPos = testPos;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    ShortcutData sc    = default(ShortcutData);
                    int          scInd = Array.IndexOf(room.shortcutsIndex, scPos);
                    if (scInd > -1 && scInd < (room.shortcuts?.Length ?? 0))
                    {
                        sc = room.shortcuts[scInd];
                    }
                    else
                    {
                        found = false;
                    }
                    if (found)
                    {
                        IntVector2 dest       = sc.DestTile;
                        Vector2    newPeekPos = ply.room.MiddleOfTile(dest);
                        if (_peekPos != newPeekPos)
                        {
                            _peekAlpha = 0f;
                            _peekPos   = newPeekPos;
                            _peekAngle = 0f;
                            for (int i = 0; i < 4; i++)
                            {
                                if (!ply.room.GetTile(dest + Custom.fourDirections[i]).Solid)
                                {
                                    _peekAngle = 180f - 90f * i;
                                    break;
                                }
                            }
                        }
                    }

                    _lastPeekAlpha = _peekAlpha;
                    _peekAlpha     = Custom.LerpAndTick(_peekAlpha, found ? Mathf.Sin(room.game.clock / 40f * Mathf.PI * 4f) * 0.25f + 0.75f : 0f, 0.1f, 0.075f);
                }

                // Allow vision when going through shortcuts
                if (plyVessel != null)
                {
                    int  updateShortCut = (int)_RainWorldGame_updateShortCut.GetValue(room.game);
                    bool first          = !_overrideEyePos.HasValue;
                    if (!first)
                    {
                        _lastOverrideEyePos = _overrideEyePos.Value;
                    }
                    _overrideEyePos = Vector2.Lerp(plyVessel.lastPos.ToVector2(), plyVessel.pos.ToVector2(), (updateShortCut + 1) / 3f) * 20f + new Vector2(10f, 10f);
                    if (first)
                    {
                        _lastOverrideEyePos = _overrideEyePos.Value;
                    }
                    if (plyVessel.room.realizedRoom != null)
                    {
                        screenblockAlpha = plyVessel.room.realizedRoom.GetTile(_overrideEyePos.Value).Solid ? 1f : 0f;
                    }
                }
                else
                {
                    _overrideEyePos = null;
                }
            }
            else
            {
                _peekAlpha = 0f;
            }

            // Don't display in arena while multiple players are present
            // This doesn't happen in story so that Monkland still works
            if (room.game.IsArenaSession && room.game.Players.Count > 1)
            {
                hideAllSprites = true;
            }
        }