ARKcc.Form1.createCommand C# (CSharp) Method

createCommand() private method

private createCommand ( int list, int index ) : string
list int
index int
return string
        private string createCommand(int list, int index)
        {
            switch (list)
            {
                case 2:
                    return (this.checkBoxAdmincheat.Checked ? "Admincheat " : "") + this.entities[index].id;
                    break;
                case 1:
                    if (this.checkBoxExact.Checked)
                    {
                        return (this.checkBoxAdmincheat.Checked ? "Admincheat " : "") + "SpawnDino " + this.entities[index].bp + " " + this.numericUpDownDistance.Value.ToString() + " " + this.numericUpDownY.Value.ToString() + " " + this.numericUpDownZ.Value.ToString() + " " + this.numericUpDownLevel.Value.ToString() + (checkBoxForceTame.Checked ? "|forcetame" : "");
                    }
                    else
                    {
                        return (this.checkBoxAdmincheat.Checked ? "Admincheat " : "") + "summon " + this.entities[index].id + (checkBoxForceTame.Checked ? "|forcetame" : "");
                    }
                    break;
                case 0:
                    if (this.entities[index].id.Length > 0 || this.entities[index].bp.Length > 0)
                    {
                        string commandstring = "";
                        string commandToPlayer = "";
                        if (checkBoxToPlayer.Checked && textBoxToPlayer.Text.Length > 0)
                        {
                            commandToPlayer = "ToPlayer " + textBoxToPlayer.Text;
                        }
                        int quantityTotal = (int)numericUpDownQuantity.Value;
                        while (quantityTotal > 0)
                        {
                            int quantity = (quantityTotal > this.entities[index].maxstack ? this.entities[index].maxstack : quantityTotal);
                            quantityTotal -= quantity;
                            commandstring += "|" + (this.checkBoxAdmincheat.Checked ? "Admincheat " : "") + (this.entities[index].id.Length > 0 ? "GiveItemNum" + commandToPlayer + " " + this.entities[index].id : "GiveItem" + commandToPlayer + " " + this.entities[index].bp) + " " + quantity.ToString() + " " + this.numericUpDownQuality.Value.ToString() + (this.checkBoxBP.Checked ? " 1" : " 0");
                        }
                        return commandstring.Substring(1);
                    }
                    break;
            }
            return "";
        }