Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

kaddle

Member
  • Content Count

    70
  • Joined

  • Last visited

Awards


This user doesn't have any awards

About kaddle

  • Title
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. does anyone know about any books (preferably on kindle) that can help me get started learning how to use unity, and how to script in unity using C#? preferably books that are friendly to people who are new to programming and game development. i pretty much have a decent understanding of most C# basics.
  2. i'm confused about the getset property auto implementation. i understand how the property itself works. class One { private int number = 50; public int Number { get { return number; } set { if (value >= 0) number = value; else number = 0; } } } class Program { static void Main(string[] args) { var one1 = new One(); one1.Number = -90; Console.WriteLine(one1.Number); Console.ReadLine(); } } the getter allows other classes to read the value of the field. the setter allows other classes to set the value of the backing field. if the getter is private then other classes can't read the field. if the setter is private then other classes can't set the value of the backing field. this is where the concept of auto implemented getset property gets confusing. the book says that when you use the shorthand to create an auto implemented property, it creates an anonymous private backing field. so how are you supposed to know what the backing field is? i thought that the whole point of using the property was to give limited access to the field from other classes in order to protect the field. are there situations when i won't need to know what the backing field is? also, if using the shorthand allows full access to reading and changing the value of the backing field (aside from making the getter or setter private), is there any point to using it?
  3. can someone please explain polymorphism simply, and the difference between static polymorphism and dynamic polymorphism? i feel like i have a mild understanding of the concept, but it is still fairly confusing at this point. from what i understand, polymorphism itself refers to when a program uses the correct method for an object even though there are other methods with the same method signature in other derived classes or the base class. is this correct and is there more to it? also why can objects be created from two different classes? for example if you have a base class named human and a derived class named male you can do: human object = new male(); i was under the impression that when creating an object it could only be using the same class name both times like: human object = new human(); i'm pretty sure that this has something to do with polymorphism, but the book i'm reading is not explaining this and i can't find an explanation in some videos either.
  4. in the book i'm reading it states that there are two ways to create a constructor for the child class. it vaguely implies that the first way is for creating the child constructor is to create a parameter-less constructor and the second way is for creating a non parameter-less constructor, but it's not exactly clear on whether that is absolute. so my questions are about whether these two ways that i will demonstrate are the only ways to create child class constructors and if the parent constructor is always called. the code below is from the exercises that i am following in the book. the book isn't the problem. it's a good book. i just need more information. class Member { protected int annualFee; private string name; private int memberID; private int memberSince; public override string ToString() { return "\nName: " + name + "\nMember ID: " + memberID + "\nMember Since: " + memberSince + "\nTotal Annual Fee: " + annualFee; } public Member() { Console.WriteLine("Parent Constructor with no parameter"); } public Member(string pName, int pMemberID, int pMemberSince) { Console.WriteLine("Parent Constructor with 3 parameters"); name = pName; memberID = pMemberID; memberSince = pMemberSince; } } class NormalMember : Member { public NormalMember() { Console.WriteLine("Child constructor with no parameter"); } public NormalMember(string remarks) : base("jamie", 1, 2015) { Console.WriteLine("Remarks = {0}", remarks); } } so in the code above we have the parent class Member and the child class NormalMember. from what i'm gathering from the book, the two ways to create a child constructor are the two ways displayed in the child class above. the first way is to make a normal constructor without any parameters, and the second way is to use the colon and base keyword. so as for my questions, am i right to assume that the only time the parent class constructor will be called when you create an object for the child class constructor is when you make a parameter-less constructor in the child class, or a non parameter-less constructor in the child class using the colon and base keyword? also, am i allowed to make a non parameter-less constructor in the child class without using the colon and base keyword? like a constructor that won't call parent class constructors when an object is made for it?
  5. i'm a bit confused by the concept of royal families. are they just like normal families but better? are they a certain part of a family that is merged with their nation's government? does each royal family serve different purposes and have different structures? i'm asking because i'm writing a story and i want to make a royal family. it doesn't need to be exactly like real royal families. anyway, it would help a lot if someone could draw a diagram or provide an explanation. i can't really find what i'm looking for on google and there are a lot of mixed answers. Royal Family Purpose: i'm thinking that this royal family in particular could have greater importance than the nation's government, but only the king and the heir would have actual authority over the government, and the government mainly serves the king, rather than the rest of the royal family. so the throne won't necessarily be merged with the government, instead they will rule over it as a superior party. also this royal family will exist in fairly modern times, so i probably won't have any sword wielding knights appointed to defend royal family members. Royal Family Structure: the actual structure of the royal family is what is most confusing. let's start with the king at the center of the structure since that will make it easier. King's Wife: in this royal family structure the ruler (king or queen) is not allowed to have more than one spouse at a given time, and they are not allowed to have concubines. does the wife of the king usually have any power? is she automatically considered the queen of the nation just for being married to the king? does it make any difference if the king's wife originates from a common family or was originally already a member of the royal family (like distantly related to the king? King's progeny (throne succession): let's say that the king has multiple children. i know that usually the heir is the firstborn. i think i'll keep that tradition in my story, but it won't be an absolute rule. the firstborn can decline the title of heir. so i understand that after the king retires and the new king comes, the line of succession continues with the new king. but what happens to the new king's siblings? what place do they have in the royal family after the line of succession shifts to the new king? Servant families: are servant families the same thing as branch families or different family houses? what is the social status of servant families relative to commoners? are different parts of the royal family served by different servant families? i'll edit this OP as needed.
  6. that's not really an issue in my region unless the bus is very packed. there were a lot of people on the bus but not quite enough that it can't be considered packed. in my region, courtesy seating is just as mandatory as priority seating, so as long as the stroller gets on the bus, people need to move for it. even if everyone gets on before the stroller they still need to leave space for the stroller, and it's only an issue if there is no room for the stroller to get on the bus after everyone else does, in which case, the parent(s) and stroller should get on a different bus or the next bus, because the parent(s) and stroller usually takes up enough space for 4-6 people standing. the benches at the front of the bus are able to be lifted to allow more room for strollers, wheelchairs, etc. even though both strollers were at the front of the bus, neither of the benches were lifted, leaving no space to safely walk by the strollers. i can't remember how many other people were at the front, but the seats at the front only fit 3 each, so it was possible for people to stand and have at least one of the benches lifted. of course the size of the strollers should also be accounted for. both strollers were big.
  7. yeah... i just woke up. i wrote this when i was very tired and irritable due to me being in the process of fixing my sleeping schedule. i ended up going to bed 4 hours sooner than i wanted, but whatever. i'll try again today. of course, i was also feeling irritable when this situation was actually happening. everything that i typed is how i feel about it, but if i was not irritable then i wouldn't have bothered typing about it, and even if i did i would have been much less aggressive about it.
  8. for the sake of discussion, feel free to discuss your experiences with this topic, or other transportation issues.. so earlier today i took the bus to the mall. usually i don't really get annoyed by much since i like to try to be a balanced person. the things that i can't stand the most are stupid people (not necessarily people with low iq, but people who just do very stupid things on a regular), virtue signalers, hypocrites, and liars. anyway, so when i was getting on the bus earlier there was a lineup of like 8 people or something. usually i am one of the first few people to get on since i have my change ready, and i know that i won't hold the line up. i also really don't want someone to just walk in ahead of me and then hold up the line for like 2-3 minutes before getting out of the way. this time i did not have my change ready. i don't mind if i don't get on first, it's just the way that it usually turns out. so right as i got my change ready and was walking to the bus behind someone else, the dumbass comes to a full stop right in front of me. i don't get it, but even though it's annoying for someone to randomly stop like that i didn't really care. so i look around to find a way around this idiot so that i can walk on the bus. as i am looking around i see that everyone else stopped as well, and there is this couple with a large fucking ass baby stroller. then i knew that i was fucked. let me explain. i know that the average folk somehow got it into their minds that the baby stroller should be let on the bus first. this notion is complete rubbish, and i have never allowed myself to be inconvenienced by this ridiculous nonsense before today. i will explain why it is stupid after i finish the story. so the dumbass in front of me is literally blocking my way and there is no way around her because a garbage bin and pole are right next to her. so they take their sweet ass time pushing the stroller onto the bus, and from the beginning of this process i had to stand there for over a minute, like i was a stupid fucking idiot, waiting for the stroller and everyone else to get on the bus because the moron in front of me didn't move when she was logically supposed to. when i finally got on the fucking bus guess what? there were a total of TWO baby strollers on the bus. the amount of space between them might as well have been non existent, almost blocking the entire passageway to get to the back of the bus. here's the problem. one of the strollers was blocking me from holding onto anything while i was dropping my money into the thing, so if the bus driver was careless and started driving the bus, i would have fell over onto the fucking stroller, most likely killing the baby inside of it. he almost did too. when the bus driver saw that i was falling the fuck over when he started the bus, he just stopped and waited. then when i was finally walking by the FUCKING strollers, the idiot asshole father didn't even try to the move the stroller more to make more walking room. "maybe he already moved the stroller as much as was possible beforehand". yeah, that's why the stroller goes on last, dumbass. i had the opportunity to test this out at least once before. the most memorable time was when i was at a bus terminal. like 15-20 people in line to get on the bus. when the bus showed up, every idiot stood aside for the stroller to get on the bus first. i took the opportunity to simply walk in front of everyone else to get on the bus and went straight to the back of the bus. after getting cozy, i watched as the mother struggled to get the baby stroller on the bus, probably also feeling a bit rushed by everyone's gazes behind her, then i also got to watch everyone waddle like dumbass penguins, struggling to walk by the baby stroller without bumping it, or falling on it, risking serious harm to the baby for each person that passes. i was waiting for like 3-4 minutes. if everyone without a stroller got on the bus first, and then the stroller got on, everything would have been much more smooth. in my region, both priority seating and courtesy seating are mandatory on public transit, so people wouldn't be allowed to take the space that the stroller would need. that would not be an issue. it's not "kind" to let the stroller go on first, because the kindness is already inherent in the courtesy seating rule. you simply cause unnecessary risk to the baby, as well as wasting more time. from now on whenever you see a stroller going on the bus with you, simply cut the stroller off and walk on first. then at least you don't have to risk tripping, falling onto a baby, and killing it. sorry for all of the swearing. i just never thought that i would become a victim of this horseshit. thinking about it made me burn with fury.
  9. i thought of and learned of various ways to aid in phone theft/loss prevention. 1. the way you holster your phone has an impact on theft/loss prevention. if you leave your phone in your pocket, this can have different pros and cons depending on how good your pockets are. deep pant pockets towards the front of the pants are likely the most difficult to pickpocket from and the most difficult to have the phone fall out of your pants. keeping your phone in your bag is probably a hit or miss. most people would avoid checking other people's bags in public areas. if they have been watching you and waiting for you to leave your bag in a secluded area, it will simple for them to take your bag or your phone from your bag without incident. a phone pouch that hooks to the belt is likely the best balance. a good phone pouch will never let your phone fall out, and it's often very easy to be aware of its presence which will help you keep track of it. when standing up, your arm may often rub against it which prevents anyone from attempting to steal it. depending on the size of the pouch and the size of your shirt, you can often completely hide it while sitting down, so no one else will be aware of it. you may be able to hide it while standing up depending on what you are wearing. 2. if you always have your earphones in while listening to music, you will know whenever your phone drops or is taken because your music will stop playing. always playing loud music will make it so that you can find your phone by hearing the music if it is dropped or taken. at the same time, loud music will alert everyone in your vicinity to the presence of your phone. 3. there is a good app that i have been testing over the last couple of days called Anti-Theft Alarm. i have it on an android device, not sure about ios. you can customize a unique pin code or pattern to use with the app, you can customize the alarm sound, alarm timer, etc. you can set it so that the alarm will trigger whenever your phone charger is taken out of your phone, whenever your phone is removed from a closed space (like your pocket or a pouch), whenever the sim card is being removed, or whenever your phone is moved at all from the location that the alarm was activated. the alarm will continue to go off at maximum volume until the pin or pattern is entered.
  10. i know that simply not bringing the phone is an option. i'm not that worried about it and i need to bring it. the main reason why i decided to go on this trip is so that i can take pictures of the sights. whenever i went on trips before, i always regretted not having a good camera with me. what i'm getting at is that i would like to take measures to reduce the odds of my phone getting lost or stolen while i'm there, or learn of ways that i can get it back. by the way, would you mind elaborating about anyone being able to reset my phone in no time? wouldn't they need access to the power button as well as my password?
  11. do you have any tips/tricks/advice to aid in preventing phone theft and misplacement. this also includes advice to find a lost or stolen phone. as for me, well... my phone. i bought this phone late last year. i was going to buy a oneplus 6 but their tagline told me "never settle", so i bought a note 9 instead. it was my first experience buying a phone for myself, and before that i was using a super lame phones. i'm going camping in about a few days. it's an indoor camping experience and i am going as part of a church group. i frequented this church ever since i was about 15 years old, so i generally trust these people. i just don't want there to be a reason for me to distrust them. also if there really is someone whom i should not trust, i want to be ready to deal with that. therefore i need to make sure that i have ways to prevent my phone from getting lost or stolen. also to get my phone back if the worst happens.
  12. i started learning about the params keyword recently. i get the gist of how it works. i just have some questions so that i can get additional information. i'm very new to programming just to let you know. simple and detailed explanations will be easier for me to understand. i typed out the code below from a template in the book i'm learning from. the disposable array and the strings passed when calling the method don't have a significant meaning. static void Main(string[] args) { void NamePrinter(params string[] tasks) { for (int i = 0; i < tasks.Length; i++) { Console.Write(tasks[i] + ", "); } Console.WriteLine(); } NamePrinter("Jon", "Jan", "Kim", "Bak", "Hok", "Rip"); Console.ReadLine(); the way this method works has similarities to the code in last thread that i made, so i pretty much understand the way it works. i only have one question relating to the way that the method works. my first question is, is the params keyword only used in front of an array? like are there other ways that the params keyword is used? if so, any examples will be helpful. regarding the for loop variable 'i'. i know that this variable represents the element positions in the 'tasks' array. my question is does the value of 'i' increase depending on how many strings are passed when calling the method? for example if i put < NamePrinter("Bob", "Bil", "Ben"); > will the value of 'i' be 2 to represent each name that i put into the array?
  13. thanks everyone for the help. i pretty much understand both methods enough to work with the code properly now. there is one concept about the second method that still confuses me. it's not a problem with understanding how the code works, it's more about understanding why the code works the way that it does. i'll post the method below and explain as best i can. i'm still new to programming lingo so i might not be able to work this clearly or properly. int[] ReturnUserInput() { int[] a = new int[3]; for (int i = 0; i < a.Length; i++) { Console.Write("Enter an integer: "); a[i] = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Integer added to array.\n"); } return a; } int[] myArray2 = ReturnUserInput(); Console.ReadLine(); so as i said before. thanks to you guys i understand the way that this method works and how to manipulate the code here. my confusion is about the concept of why the int i variable in the for loop works the way that it does. how exactly does c# know that the for loop is accessing the positions of the elements in the array 'a' by using the variable int i to represent the element position in the array? to put it differently, how does c# know that the value of int i is representative of the corresponding element positions in the array 'a'?
  14. i bought this keyboard last year and the media keys have always worked as normal. the change track and pause/play keys would always affect my music player. i use windows media player. i'm sure the problem is not the keyboard. yesterday when i use the pause/play media key on the keyboard, it started to affect youtube instead of my music player like normal. it only goes back to normal when i close youtube, but i almost always have a youtube tab open. the keys to change the track always work with my music player as far as i can tell. i need my media keys to always affect my music player, but i don't know how to make it function normally again. any help?
×