C
C#•9mo ago
Black in Italian

Error CS1502; Unity Mobile Developement

How do I fix this?
public class DLLocalizationManager : LocalizationManager
{
public DLLocalizationManager(IHttpClient httpClient, IAppInfo appInfo) : base(default(IHttpClient), default(IAppInfo), default(Localization), default(LocalizationManager.CsvMode), default(LocalizationManager.CsvLoadedDelegate))
{
}

}
public class DLLocalizationManager : LocalizationManager
{
public DLLocalizationManager(IHttpClient httpClient, IAppInfo appInfo) : base(default(IHttpClient), default(IAppInfo), default(Localization), default(LocalizationManager.CsvMode), default(LocalizationManager.CsvLoadedDelegate))
{
}

}
"has some invalid arguments" thanks Unity
27 Replies
Angius
Angius•9mo ago
Check what the base class constructor actually wants, because CS1502 means you're giving it something it does not want As a side note, with the default, you're giving it a bunch of nulls
Black in Italian
Black in ItalianOP•9mo ago
hmmmmm okay I'll give it a try. I love your name btw
Angius
Angius•9mo ago
Helps me hide at the botton of the user list lol
Black in Italian
Black in ItalianOP•9mo ago
hey random question, I'm REALLY new to programming, does fixing something make other errors be discovered in Unity because I had 2 errors I fixed thinking they were my last one, I was like yes I'm a genious, and then 3 more popped up
Angius
Angius•9mo ago
Sometimes fixing an error does cause another error to appear, yes We call it "progress" lol If you're as new as you claim to be, I'd recommend not starting with Unity though
Black in Italian
Black in ItalianOP•9mo ago
error CS1729: The type SocialPoint.Utils.PriorityQueue<T,System.Action>' does not contain a constructor that takes 0' arguments also occurs here, and I don't know what it means this unfortunately is the ONLY thing I want to do as far as programming goes, I'm just trying to get an abandonware mobile game running
Angius
Angius•9mo ago
It means the constructor of the PriorityQueue class takes some parameters There's no constructor with zero of them
Black in Italian
Black in ItalianOP•9mo ago
fuck okay
Angius
Angius•9mo ago
So, again, look at the class, look at it's constructors, see which one you want to use Which is something you'd learn were you to start by learning C#, not by learning Unity 😛
Black in Italian
Black in ItalianOP•9mo ago
using System;

namespace SocialPoint.Utils
{
public class PriorityAction<T> : PriorityQueue<T, Action>
{
}
}
using System;

namespace SocialPoint.Utils
{
public class PriorityAction<T> : PriorityQueue<T, Action>
{
}
}
so the constrictures are T and Action here right?
Angius
Angius•9mo ago
Constructors And no $structure
MODiX
MODiX•9mo ago
namespace Namespace;

[Attribute]
public class Class
{
public string PublicField;
private bool _privateField;

public int PublicProperty { get; set; }

public Class() {} // Constructor

public void Method(int parameter)
{
var localVariable = parameter;
}
}
namespace Namespace;

[Attribute]
public class Class
{
public string PublicField;
private bool _privateField;

public int PublicProperty { get; set; }

public Class() {} // Constructor

public void Method(int parameter)
{
var localVariable = parameter;
}
}
Black in Italian
Black in ItalianOP•9mo ago
lol hmm okay, that makes sense! maybe I need a bracket to seperate it
Angius
Angius•9mo ago
A class will inherit the constructors of the parent class
Black in Italian
Black in ItalianOP•9mo ago
using System; namespace SocialPoint.Utils { public class { PriorityAction<T> : PriorityQueue<T, Action> } { } } this looks really bad
Angius
Angius•9mo ago
If there are no ctors in PriorityAction, there might be ctors in PriorityQueue It does look bad and won't even compile, you're right
Black in Italian
Black in ItalianOP•9mo ago
oh goodness okay what is a ctor
Angius
Angius•9mo ago
constructor
Black in Italian
Black in ItalianOP•9mo ago
okay i feel like i need to undo work now lol let me think
Angius
Angius•9mo ago
That's where source control comes in clutch, but I don't suppose you use source control So ctrl-z what you can ig
Black in Italian
Black in ItalianOP•9mo ago
namespace SocialPoint.Utils
{
public class PriorityAction : PriorityAction<int>
{
}
}
namespace SocialPoint.Utils
{
public class PriorityAction : PriorityAction<int>
{
}
}
so I think this is where the ctor comes from and then ummmmm PriorityQueue inherets it here maybe I might manually do it, I already had a blunder changing MonoBehaviour to UnityEngineMonoBehaviour instead of PhotonMonoBehaviour and had to just restart basically thankfully there's only a couple things I really need to change this would probably be an easy project for someone who knew C#
Angius
Angius•9mo ago
Possibly
Black in Italian
Black in ItalianOP•9mo ago
I might call it a night thank you ZZZZZZZZZZZZZZZZZZ actually I have a quick question how morally ambiguous is it to edit someone's code that I didn't make to play a game like where does the line between decompiling and just well the code was there start and if I use someone else's code, is that morally bad in the programming world
Angius
Angius•9mo ago
Does the game permit such modifications explicitly?
Black in Italian
Black in ItalianOP•9mo ago
no lol
Angius
Angius•9mo ago
Then it's not legal Morality of it is up for debate
Black in Italian
Black in ItalianOP•9mo ago
that's good to know thank you I will be the only one playing it, and my sister, so I am morally okay with it
Want results from more Discord servers?
Add your server