Click here to Skip to main content
16,011,868 members
Home / Discussions / C#
   

C#

 
GeneralRe: error CS0051: Inconsistent accessibility Pin
George_George24-Jun-08 1:50
George_George24-Jun-08 1:50 
GeneralRe: error CS0051: Inconsistent accessibility Pin
User 665823-Jun-08 0:35
User 665823-Jun-08 0:35 
GeneralRe: error CS0051: Inconsistent accessibility Pin
George_George23-Jun-08 1:35
George_George23-Jun-08 1:35 
QuestionLink List Pin
benjamin yap22-Jun-08 18:02
benjamin yap22-Jun-08 18:02 
AnswerRe: Link List Pin
Christian Graus22-Jun-08 18:21
protectorChristian Graus22-Jun-08 18:21 
GeneralRe: Link List Pin
benjamin yap22-Jun-08 19:56
benjamin yap22-Jun-08 19:56 
AnswerRe: Link List Pin
User 665822-Jun-08 20:12
User 665822-Jun-08 20:12 
GeneralRe: Link List Pin
benjamin yap22-Jun-08 20:35
benjamin yap22-Jun-08 20:35 
this is the linklist class i created

class LinkedList
{
    //attributes
    private Node head, tail;
    private int size;

    //constructor
    public LinkedList()
    {
        head = null;
        size = 0;
    }

    //properties
    public Node Tail
    {
        get { return tail; }
    }

    public Node Head
    {
        get { return head; }
    }

    public int Size
    {
        get { return size; }
    }

    //methods
    public void AddFront(object data)//Part A (1)
    {
        //create a new node that set the link to point to the head of linkedList
        Node newNode = new Node(data, head);
        if (head == null)
            tail = newNode;

        //set this new node to be the head of the linked list
            head = newNode;

        //increase the size of the LinkedList
            size++;
    }

    public void AddRear(object data)//Part A (2)
    {
        //create new node
        Node newNode = new Node(data, null);
        if (head == null)
        {
            head = newNode;
            tail = newNode;
            size++;
        }
        else //list not empty
        {
            tail.Link = newNode;
            tail = newNode;
            size++;
        }
    }

    public bool DeleteFront()//Part A (3)
    {
        if (head == null) //empty list
            return false;
        else //list not empty
        {
            head = head.Link;
            size--;
            return true;
        }
    }

And this is my Node class

using System;

namespace GameCharacterTrackingSystem
{
    public class Node
    {
        object data;
        Node link;

        public Node(object d, Node l)
        {
            data = d;
            link = l;
        }

        public object Data
        {
            get
            {
                return data;
            }
            set
            {
                data = value;
            }
        }

        public Node Link
        {
            get
            {
                return link;
            }
            set
            {
                link = value;
            }
        }
    }
}


This is my Entity class which will create the object to be store in my linklist

using System;
using System.Collections.Generic;
using System.Text;

namespace GameCharacterTrackingSystem
{
    class Entity 
    {
        //attrubutes
        private string type;
        private string name;
        private int level;

        //constructor
        public Entity()
        {
            type = null;
            name = null;
            level = 0;
        }

        public Entity(string type, string name, int level)
        {
            this.type = type;
            this.name = name;
            this.level = level;
        }

        //properties
        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public int Level
        {
            get { return level; }
            set { level = value; }
        }

        //method
        public override string ToString()
        {
            return "Type    : " + type + ",   Name    : " + name + ",    Level   : " + level;
        }


    }
}


Inside LinkList.cs i want to add another method to sort the stored Entity by level, name and type.. how should the method be write?
GeneralRe: Link List Pin
Christian Graus22-Jun-08 21:14
protectorChristian Graus22-Jun-08 21:14 
AnswerRe: Link List Pin
leppie22-Jun-08 21:16
leppie22-Jun-08 21:16 
GeneralRe: Link List Pin
benjamin yap23-Jun-08 0:30
benjamin yap23-Jun-08 0:30 
GeneralRe: Link List Pin
User 665823-Jun-08 0:43
User 665823-Jun-08 0:43 
GeneralRe: Link List Pin
Anthony Mushrow23-Jun-08 1:07
professionalAnthony Mushrow23-Jun-08 1:07 
GeneralRe: Link List Pin
leppie23-Jun-08 11:18
leppie23-Jun-08 11:18 
GeneralRe: Link List [modified] Pin
benjamin yap23-Jun-08 17:09
benjamin yap23-Jun-08 17:09 
GeneralRe: Link List Pin
leppie23-Jun-08 21:23
leppie23-Jun-08 21:23 
GeneralRe: Link List Pin
benjamin yap24-Jun-08 2:09
benjamin yap24-Jun-08 2:09 
QuestionWhich to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 17:06
benjamin yap22-Jun-08 17:06 
AnswerRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 17:48
protectorChristian Graus22-Jun-08 17:48 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 17:57
benjamin yap22-Jun-08 17:57 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 17:59
protectorChristian Graus22-Jun-08 17:59 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 19:40
benjamin yap22-Jun-08 19:40 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 19:44
protectorChristian Graus22-Jun-08 19:44 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 19:49
benjamin yap22-Jun-08 19:49 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 19:57
protectorChristian Graus22-Jun-08 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.