Exemplo n.º 1
0
        // ==================== Constructors ======================
        public Tile( Tile C )
        {
            this.Passable = C.Passable;
            this.Visible = C.Visible;
            this.Occupied = C.Occupied;

            // Inherited From Container
            this.Holds = C.Holds;
            this.Openwith = C.Openwith;
            this.Locked = C.Locked;
            this.Capacity = C.Capacity;

            // Inherited From AdvObject
            this.Color = C.Color;
            this.Title = C.Title;
            this.Visible = C.Visible;
            this.LocX = C.LocX;
            this.LocY = C.LocY;
            this.Name = C.Name;
            this.Desc = C.Desc;
            this.Id = C.Id;
        }
Exemplo n.º 2
0
 public void MoveLO(Tile [,] world, int x, int y)
 {
     world[x, y].Occupied = this;
     world[LocX, LocY].Occupied = null;
     LocX = x;
     LocY = y;
     Console.WriteLine("{0} Moved into {1} ", this.Name, world[this.LocX, this.LocY].Name);
     Console.WriteLine(world[this.LocX, this.LocY].Desc);
 }
Exemplo n.º 3
0
        // ==================== Methods Section ======================
        public void Look(Tile[,] world, int a, int b, int c, int d)
        {
            String peoples = "";

            Console.WriteLine("{0} looks around and sees: ", this.Name);
            Console.Write("Items: ");
            for (int j = b; j <= d; j++)
            {
                for (int i = a; i <= c; i++)
                {
                    if(world[i, j].Holds.Count > 0)
                    {
                        world[i, j].Holds.ForEach(PrintName);
                    }
                //    if (world[i, j].Occupied != null && i != this.LocX && j != this.LocY)
                    if (world[i, j].Occupied != null && world[i,j].Occupied.Name != this.Name)
                    {
                        peoples += world[i, j].Occupied.Name + " The " + world[i, j].Occupied.Title + ", ";
                    }
                }
            } // End for

            Console.WriteLine("");
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.Write(peoples);
            Console.ResetColor();
            Console.WriteLine("");
        }
Exemplo n.º 4
0
 // Validate move observes map tile rules
 public bool ChkTileMove(Tile T)
 {
     if ((T.Name == "Entry" | T.Name == T.Name | T.Name == "Entry") && T.Passable == true && T != null
             && T.PassReq == false && T.Occupied == null)
         return true;
     else if ((T.Name == "Entry" | T.Name == T.Name | T.Name == "Entry") && T.Passable == true && T != null
             && T.PassReq == true && (this.LHand != null | this.RHand != null) && T.Occupied == null)
     {
         if (this.LHand != null)
             if (this.LHand.Name.ToString() == T.PassPair.Name.ToString())
                 return true;
             else
                 return false;
         else if (this.RHand != null)
             if (this.RHand.Name.ToString() == T.PassPair.Name.ToString())
                 return true;
             else
                 return false;
         else
             return false;
     }
     else
         return false;
 }
Exemplo n.º 5
0
 // Generate a new tile for map init
 // ============== Private Methods Section =================
 private Tile NewTile(XDocument X, String type, int x, int y)
 {
     Tile T = new Tile();
     T.Name = (String)X.Element("maptranslator").Element(type).Element("Name");
     T.Desc = (String)X.Element("maptranslator").Element(type).Element("Description");
     T.Id = (String)X.Element("maptranslator").Element(type).Element("ID");
     T.Color = (String)X.Element("maptranslator").Element(type).Element("Color");
     T.LocX = x;
     T.LocY = y;
     return T;
 }
Exemplo n.º 6
0
        // ISSUES
        // ==================== Methods Section ======================
        public void GetItem(Tile[,] world, int a, int b, int c, int d, String n)
        {
            int g = 0, w = 0, x = 0, y = 0;

            for (int j = b; j <= d; j++)
            {
                for (int i = a; i <= c; i++)
                {
                    if (world[i, j].Holds != null)
                    {
                        w = 0;
                        foreach (Item it in world[i,j].Holds)
                        {
                            if (it.Name == n)
                            {
                                if(it.Baggable == true) {
                                    g = w;
                                    this.Carrying.Holds.Add(it);
                                    x = i;
                                    y = j;
                                    Console.ForegroundColor = ConsoleColor.Green;
                                    Console.WriteLine(Name + " received " + it.Name);
                                    Console.ResetColor();
                                }
                            }
                            w++;
                        }
                    }
                }
            } // End for
            world[x, y].Holds.RemoveAt(g);
        }