'Game.Server.Gameobjects.Gameplayer' does not implement interface Member 'Game.Logic.Igameplayer.Addprestige(bool)'

Asked

Viewed 33 times

0

Error:

'Game.Server.Gameobjects.Gameplayer' does not implement interface Member 'Game.Logic.Igameplayer.Addprestige(bool)'

Code:

public class GamePlayer : IGamePlayer
{
    public void AddPrestige(bool isWin, eRoomType roomType)
    {
      if (roomType == eRoomType.RingStation)
      {
        UserRingStationInfo ringStationInfos = RingStationMgr.GetSingleRingStationInfos(this.PlayerCharacter.ID);
        if (ringStationInfos != null)
        {
          int num = RingStationMgr.ConfigInfo.AwardBattleByRank(ringStationInfos.get_Rank(), isWin);
          string translation = LanguageMgr.GetTranslation("Ringstasion.BattleLost", (object) num);
          if (isWin)
          {
            num = RingStationMgr.ConfigInfo.AwardBattleByRank(ringStationInfos.get_Rank(), isWin);
            translation = LanguageMgr.GetTranslation("Ringstasion.BattleWin", (object) num);
          }
          this.AddLeagueMoney(num);
          this.SendMessage(translation);
        }
      }
      if (roomType != eRoomType.BattleRoom)
        return;
      this.BattleData.AddPrestige(isWin);
    }

Posted summarized to you, because the whole code has more than a thousand lines, who wants the whole code comments.

  • Please help me, if you need more things I put here

  • Hello, welcome to SOPT. You already have an answer that will certainly help you, but the quality of your question is very low. This makes it difficult for people to be interested in answering. If you haven’t done it yet, do the [tour] and, above all, be sure to read [Ask].

1 answer

1

The problem is the method signature AddPrestige, interface has only one parameter boolean and its implementation of the method takes two parameters, a boolean and a eRoomType.

You need to make your method as the interface asks.

public void AddPrestige(bool isWin) { }

There may be two methods with the same, but with different signatures as well. In this case, you need to implement the two interface members.

There’s no helping you anymore because you didn’t give more details about the problem.

  • For that would have to delete eRoomType? would not have to add in the other code that in the case is this that is in Igameplayer?: void Addprestige(bool isWin); void Ringstationresult(bool isWin);

  • If you have access to the interface, you can change. If not, you can create a method with the same name that has different parameters (this is called Overload).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.