jonldavis
Member
- ServUO Version
- Publish Unknown
- Ultima Expansion
- None
Can anyone help with fixing these errors.
I guess I'll post them as I go.
SBGardener.cs
Errors are with the four that I underlined
Two of them - InternalBuyInfo()
Error: CS0121 - The call is ambiguous between the following methods or properties: 'method1' and 'method2'
Two of them - m_BuyInfo
Error: CS0229 - Ambiguity between 'member1' and 'member2'
Besides explaining how to fix them if you could also explain this coding in C#?
I'm trying to learn C# but I'm confused on why you would do this.
When I created a List it usually goes something like this...
List<string> list = new List<string>();
Meaning my List used the string class to start with and to end with.
But in the coding below they start with one class and end with another method.
List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
Maybe someone can point me to a video or website that explains this kind of a List.
The next thing I'm confused on:
What does this mean: =>
public override IShopSellInfo SellInfo => m_SellInfo;
I guess I'll post them as I go.
SBGardener.cs
Errors are with the four that I underlined
Two of them - InternalBuyInfo()
Error: CS0121 - The call is ambiguous between the following methods or properties: 'method1' and 'method2'
Two of them - m_BuyInfo
Error: CS0229 - Ambiguity between 'member1' and 'member2'
""
private readonly List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private readonly IShopSellInfo m_SellInfo = new InternalSellInfo();
public override IShopSellInfo SellInfo => m_SellInfo;
public override List<GenericBuyInfo> BuyInfo => m_BuyInfo;
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{
Add(new GenericBuyInfo(typeof(Hoe), 17, 20, 0xE86, 2524));
Add(new GenericBuyInfo(typeof(GardeningContract), 10156, 500, 0x14F0, 0));
Add(new GenericBuyInfo("1060834", typeof(Engines.Plants.PlantBowl), 2, 20, 0x15FD, 0));
Add(new BeverageBuyInfo(typeof(Pitcher), BeverageType.Water, 11, 20, 0x1F9D, 0));
}
}
Besides explaining how to fix them if you could also explain this coding in C#?
I'm trying to learn C# but I'm confused on why you would do this.
When I created a List it usually goes something like this...
List<string> list = new List<string>();
Meaning my List used the string class to start with and to end with.
But in the coding below they start with one class and end with another method.
List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
Maybe someone can point me to a video or website that explains this kind of a List.
The next thing I'm confused on:
What does this mean: =>
public override IShopSellInfo SellInfo => m_SellInfo;
Last edited: