Esempio n. 1
0
    //Populate boardspace data from constructor
    public void PopulateBoardspace(ref Boardspace NextIn, ref Boardspace PreviousIn, string Name, string SpaceTypeIn)
    {
        //Assign correct previous and next values to current boardspace
        this.Next     = NextIn;
        this.Previous = PreviousIn;

        //Reassign previous/next values for adjacent boardspaces
        this.Next.Previous = this;
        this.Previous.Next = this;

        //Assign name of boardspace
        this.SpaceName = Name;
        this.SpaceType = SpaceTypeIn;
    }
Esempio n. 2
0
 public CardSpace(Boardspace BoardspaceIn) : base(ref BoardspaceIn)
 {
 }
Esempio n. 3
0
 public GoToJail(Boardspace BoardspaceIn) : base(ref BoardspaceIn)
 {
 }
Esempio n. 4
0
    public Player Owner;     //Always Banker



    public LuxuryTax(Boardspace BoardspaceIn, Player OwnerIn) : base(ref BoardspaceIn)
    {
        Owner = OwnerIn;
    }
Esempio n. 5
0
    public Player Owner;     //Always Banker


    public IncomeTaxSpace(Boardspace BoardspaceIn, Player OwnerIn) : base(ref BoardspaceIn)
    {
        Owner = OwnerIn;
    }
Esempio n. 6
0
 //Constructor for Boardspace input
 public Boardspace(ref Boardspace BoardspaceToCopy)
 {
     PopulateBoardspace(ref BoardspaceToCopy.Next, ref BoardspaceToCopy.Previous, BoardspaceToCopy.SpaceName, BoardspaceToCopy.SpaceType);
 }
Esempio n. 7
0
    public void Board()
    {
        TitleProperty TempTitleProperty;
        Boardspace    temp;
        Boardspace    nexttemp = null;

        CurrBoard = new Board();

        //Set up double circular linked list of board spaces
        string BoardSpacesTblFP = System.String.Concat(this.FP, "/Raw Data/BoardSpacesTbl.csv");
        var    BoardSpacesTbl   = new StreamReader(@BoardSpacesTblFP);

        var        line     = BoardSpacesTbl.ReadLine();
        Boardspace prevtemp = new Boardspace();

        //Set up linked list of board spaces
        while (!BoardSpacesTbl.EndOfStream)
        {
            line = BoardSpacesTbl.ReadLine();
            var values = line.Split(',');


            temp = new Boardspace(values[0], values[1]);

            if (values[1] == "GO")
            {
                this.CurrBoard.GoSpace = temp;
            }
            else
            {
                temp.Previous = prevtemp;
                prevtemp.Next = temp;
            }


            prevtemp = temp;
            //Console.WriteLine(values[0]);
        }


        this.CurrBoard.GoSpace.Previous = prevtemp;
        prevtemp.Next = this.CurrBoard.GoSpace;


        BoardSpacesTbl = new StreamReader(@BoardSpacesTblFP);

        line = BoardSpacesTbl.ReadLine();



        temp = this.CurrBoard.GoSpace;

        do
        {
            if (temp.SpaceType == "GO")
            {
                this.CurrBoard.GoSpace = new GoSpace(ref temp);
            }
            if (temp.SpaceType == "Community Chest")
            {
                new CommunityChestCardSpace(temp);
            }
            if (temp.SpaceType == "Chance")
            {
                new ChanceCardSpace(temp);
            }
            if (temp.SpaceType == "Jail")
            {
                new Jail(temp);
            }
            if (temp.SpaceType == "Income Tax")
            {
                new IncomeTaxSpace(temp, this.Banker);
            }
            if (temp.SpaceType == "Luxury Tax")
            {
                new LuxuryTax(temp, this.Banker);
            }
            if (temp.SpaceType == "GO TO JAIL")
            {
                new GoToJail(temp);
            }
            temp = temp.Next;
        }while (temp.SpaceName != CurrBoard.GoSpace.SpaceName);



        string PropertyTblFP = System.String.Concat(this.FP, "/Raw Data/PropertyTbl.csv");
        var    PropertyTbl   = new StreamReader(@PropertyTblFP);

        Property TempProperty;

        temp = this.CurrBoard.GoSpace;
        line = PropertyTbl.ReadLine();



        //Set up property
        while (!PropertyTbl.EndOfStream)
        {
            line = PropertyTbl.ReadLine();
            //Console.WriteLine(line);
            var values = line.Split(',');


            string PropType = values[3];
            temp         = FindSpaceName(values[1]);
            TempProperty = new Property(Convert.ToInt64(values[2]), ref temp, this.Banker);

            //Find out if property is TitleProperty,Railroad or utility and create appropriate object
            if (PropType == "Title Property")
            {
                var values2 = ReturnPropertyData(values[1]);
                Console.WriteLine(values2[1]);
                TempTitleProperty = new TitleProperty(values2[1], Convert.ToInt64(values2[2]), Convert.ToInt64(values2[3]), Convert.ToInt64(values2[4]),
                                                      Convert.ToInt64(values2[5]), Convert.ToInt64(values2[6]), Convert.ToInt64(values2[7]), Convert.ToInt64(values2[8]),
                                                      Convert.ToInt64(values2[9]), Convert.ToInt64(values2[10]), Convert.ToInt64(values2[11]), Convert.ToInt64(values2[12]), ref TempProperty);
                Console.WriteLine(this.CurrBoard.GoSpace.Next.GetType());
                Console.WriteLine(TempTitleProperty.GetType());
            }
            if (PropType == "Railroad")
            {
                Railroad TempRail;
                TempRail = new Railroad(TempProperty);
            }
            if (PropType == "Utility")
            {
                Utility TempUtil;
                TempUtil = new Utility(TempProperty);
            }


            //Console.WriteLine(TempProperty.SpaceName);
        }
    }
Esempio n. 8
0
 public Property(long CostToBuyIn, ref Boardspace PropertySpaceIn, Player InitialOwner) : base(ref PropertySpaceIn)
 {
     this.CostToBuy = CostToBuyIn;
     this.Owner     = InitialOwner;
 }
Esempio n. 9
0
 public CommunityChestCardSpace(Boardspace BoardspaceIn) : base(BoardspaceIn)
 {
 }
Esempio n. 10
0
 public ChanceCardSpace(Boardspace BoardspaceIn) : base(BoardspaceIn)
 {
 }
Esempio n. 11
0
 public GoSpace(ref Boardspace BoardspaceIn) : base(ref BoardspaceIn)
 {
 }