Exemplo n.º 1
0
        public Building(BuildingType buildingType, Island island)
        {
            this.BuildingType = buildingType;
            this.ResourceManager = new ResourceManager();
            this.BuildState = 0;
            this.Island = island;
            this.ConstructionResourceNeeded = new List<Tuple<ResourceType, int>>();

            this.Name = String.Empty;
            switch (buildingType)
            {
                case BuildingType.Scierie:
                    this.ConstructionResourceNeeded.Add(new Tuple<ResourceType, int>(ResourceType.Or, 3));
                    this.ResourceManager.addResource(ResourceType.Bois, "bois", 0, 4);
                    //ressourceNeeded = "or";
                    //consumptionCost = 3;
                    //ressourceProduced = "bois";
                    //productionCost = 4;
                    this.ConstructionTime = 5;
                    break;
                case BuildingType.Mine:
                    this.ResourceManager.addResource(ResourceType.Or, "Or", 0, 1);
                    this.ConstructionTime = 0;
                    break;
                case BuildingType.Usine:
                    this.ConstructionTime = 0;
                    break;
                case BuildingType.Ferme:
                    this.ConstructionTime = 0;
                    break;
            }
            //this.build();
        }
Exemplo n.º 2
0
 public void giveRessourceToIsland(ResourceType resourceType, int quantity, Island islandDest)
 {
     if(this.ResourceManager.changeResourceStock(resourceType, - quantity))
     {
         islandDest.ResourceManager.changeResourceStock(resourceType, quantity);
         if(this.TransferResourceToIsland != null)
         {
             this.TransferResourceToIsland(this, new TransferResourceToIslandEventArgs { Origin = this,
                                                                                         Destination = islandDest,
                                                                                         ResourceType = resourceType,
                                                                                         Quantity = quantity });
         }
     }
 }
Exemplo n.º 3
0
        public IslandControls(Island island, Canvas canvas, int posX, int posY)
        {
            this.Island = island;
            this.Canvas = canvas;
            this.Position = new int[2];
            this.Position[0] = posX;
            this.Position[1] = posY;
            this.MainListViewButtonList = new List<TouchButton>();
            this.MinorListViewButtonList = new List<TouchButton>();
            this.MainListView = new TouchListView();
            this.Canvas.Children.Add(this.MainListView);
            this.MinorListView = new TouchListView();
            this.MinorWindowVisible = false;

            this.show();
        }
 public BuildingManager(Island island)
 {
     this.Island = island;
 }
Exemplo n.º 5
0
 public Building(BuildingType buildingType, Island island, string name) : this(buildingType, island)
 {
     this.Name = name;
 }