コード例 #1
0
        public override int Execute(LogicLevel level)
        {
            LogicClientAvatar playerAvatar = level.GetPlayerAvatar();

            if (playerAvatar != null)
            {
                if (this.m_unitData != null)
                {
                    playerAvatar.AddAllianceUnit(this.m_unitData, this.m_upgLevel);
                    playerAvatar.GetChangeListener().AllianceUnitAdded(this.m_unitData, this.m_upgLevel);
                    level.GetGameListener().UnitReceivedFromAlliance(this.m_senderName, this.m_unitData, this.m_upgLevel);

                    if (level.GetState() == 1 || level.GetState() == 3)
                    {
                        level.GetComponentManagerAt(0).AddAvatarAllianceUnitsToCastle();
                    }

                    return(0);
                }
            }

            return(-1);
        }
 public override void ApplyAvatarChange(LogicClientAvatar avatar)
 {
     avatar.AddAllianceUnit(this.Data, this.UpgradeLevel);
 }