예제 #1
0
        public static UIElement Shape(this ObjectCategory self)
        {
            Canvas shape;
            switch (self)
            {
                case ObjectCategory.ThunderstruckTree: shape = new Thunderstruck(); break;

                case ObjectCategory.HarvestableTree: shape = new Tree(false); break;
                case ObjectCategory.FruitedTree: shape = new Tree(true); break;

                //case ObjectCategory.Uprootable: shape = new Up(); break;

                case ObjectCategory.ScarecrowGarden: shape = new Garden(); break;

                case ObjectCategory.SmallHousing: shape = new SmallHouse(); break;

                case ObjectCategory.Farmhouse: shape = new Farmhouse(); break;
                case ObjectCategory.LargeHousing: shape = new LargeHouse(); break;

                case ObjectCategory.HarvestablePlant: shape = new Leaf(); break;
                case ObjectCategory.ScarecrowFarm: shape = new Farm(); break;
                case ObjectCategory.HousingWorkbench: shape = new HousingWorkbench(); break;
                
                case ObjectCategory.FriendlyPlayer: shape = new PlayerShape(true); break;
                case ObjectCategory.EnemyPlayer: shape = new PlayerShape(false); break;

                case ObjectCategory.FriendlyClipper: shape = new Clipper(true); break;
                case ObjectCategory.EnemyClipper: shape = new Clipper(false); break;

                case ObjectCategory.FriendlyMerchantShip: shape = new MerchantShip(true); break;
                case ObjectCategory.EnemyMerchantShip: shape = new MerchantShip(false); break;

                case ObjectCategory.FriendlyFishingBoat: shape = new FishingShip(true); break;
                case ObjectCategory.EnemyFishingBoat: shape = new FishingShip(false); break;

                case ObjectCategory.FriendlyGalleon: shape = new Galleon(true); break;
                case ObjectCategory.EnemyGalleon: shape = new Galleon(false); break;
                case ObjectCategory.FriendlyNPC: shape = new NpcShape(true); break;
                
                case ObjectCategory.TradePack: shape = new TradePack(); break;
                case ObjectCategory.Treasure: shape = new Treasure(); break;
                case ObjectCategory.FishSchool: shape = new Fish(); break;

                case ObjectCategory.EnemyNPC: shape = new NpcShape(false); break;
                    
                default:
                    Ellipse dot = DrawSimpleDot();
                    dot.Fill = self.Color();
                    return dot;       
            }

            //need to flip the shape because our canvas is inverted (due to game coordinate system)
            return Flip(shape);
        }
예제 #2
0
 public void Reset()
 {
     this.result = new SmallHouse();
 }