public void SpawnBird(BirdType _type, Direction _dir, int _count) { GameObject _BirdModel = _regularBird; switch (_type) { case BirdType.Regular: _BirdModel = _regularBird; break; case BirdType.Fast: _BirdModel = _fastBird; break; case BirdType.Big: _BirdModel = _bigBird; break; } switch (_dir) { case Direction.Horizontal: StartCoroutine(SpawnWavesHorizontal(_BirdModel, _count)); break; case Direction.Vertical: StartCoroutine(SpawnWavesVertical(_BirdModel, _count)); break; case Direction.Diagonal: StartCoroutine(SpawnWavesDiagonal(_BirdModel, _count)); break; } }
/// <summary> /// WoodPecker constructor, passed to it is the property values /// This constructor calls the bird constructor (as a WoodPecker is a bird) /// </summary> /// <param name="name">Name</param> /// <param name="age">Age</param> /// <param name="gender">Gender</param> /// <param name="typeOfBird">As marchsandpiper is a bird, type of bird needs to be passed</param> /// <param name="typeOfBeak">This is a marchsandpiper property</param> public WoodPecker(string name, int age, Gender gender, BirdType typeOfBird, BeakType typeOfBeak) : base(name, age, gender, typeOfBird) { foodSchedule = new FoodSchedule(); foodSchedule.Add("Tree insects once a day."); foodSchedule.Add("Tree liters of water once a week"); TypeOfBeak = typeOfBeak; }
void SpawnBird(BirdType birdType) { Vector3 spawnPos = Vector3.zero; Quaternion spawnRot = Quaternion.identity; if (birdType.prefab.name == "SimpleBird") { spawnPos = Random.onUnitSphere * GameManager.Instance.worldRadius; spawnPos.y = Mathf.Abs(spawnPos.y); spawnRot = Quaternion.LookRotation(Vector3.zero - spawnPos, Vector3.up); } else if (birdType.prefab.name == "TurdBird") { float height = birdType.prefab.GetComponent <TurdBird>().height; Vector3 temp = Random.insideUnitCircle.normalized * GameManager.Instance.worldRadius; spawnPos = new Vector3(temp.x, height, temp.y); spawnRot = Quaternion.LookRotation(new Vector3(0, height, 0) - spawnPos, Vector3.up); } else if (birdType.prefab.name == "Swoopy") { float height = birdType.prefab.GetComponent <SwoopBird>().height; Vector3 temp = Random.insideUnitCircle.normalized * GameManager.Instance.worldRadius; spawnPos = new Vector3(temp.x, height, temp.y); spawnRot = Quaternion.LookRotation(new Vector3(0, height, 0) - spawnPos, Vector3.up); } Instantiate(birdType.prefab, spawnPos, spawnRot); _wave.lastSpawn = _wave.timer; aliveBirds++; }
/// <summary> /// MarchSandpiper constructor, passed to it is the property values /// This constructor calls the bird constructor (as a MarchSandpiper is a bird) /// </summary> /// <param name="name">Name</param> /// <param name="age">Age</param> /// <param name="gender">Gender</param> /// <param name="typeOfBird">As marchsandpiper is a bird, type of bird needs to be passed</param> /// <param name="wingSpan">This is a marchsandpiper property</param> /// <param name="plumage">This is a marchsandpiper property</param> public MarchSandpiper(string name, int age, Gender gender, BirdType typeOfBird, int wingSpan, Plumage plumage) : base(name, age, gender, typeOfBird) { foodSchedule = new FoodSchedule(); foodSchedule.Add("One insect for once a week."); WingSpan = wingSpan; Plumage = plumage; }
public static object ConvertToTypeSafeEnum(string typeName, string value) { switch (typeName) { case "BirdType": return(BirdType.Parse(value)); //case "SomeOtherType": // other type safe enums // return // some other type safe parse call default: return(null); } }
public static bool TryParse(string value, out BirdType type) { try { type = Parse(value); return(true); } catch { type = null; return(false); } }
public Milestone(int amount, string id = null, BirdType birdType = BirdType.Blue, List<Direction> directions = null) { Amount = amount; Id = id; Directions = directions; if (directions == null) { Directions = new List<Direction>(); } BirdType = birdType; }
/// <summary> /// Creates Bird /// </summary> /// <param name="bird">Species</param> /// <param name="id">ID</param> /// <param name="birdSpecific">Bird characteristics</param> /// <param name="speciesSpecific">Species characteristics</param> /// <returns>New Bird</returns> private static Animal CreateBird(BirdType bird, int id, string birdSpecific, string speciesSpecific) { switch (bird) { case BirdType.Dove: return(new Dove(id, birdSpecific, speciesSpecific)); case BirdType.Eagle: return(new Eagle(id, birdSpecific, speciesSpecific)); case BirdType.Pelican: return(new Pelican(id, birdSpecific, speciesSpecific)); default: return(null); } }
public IBird Get(string type) { BirdType bt = (BirdType)Enum.Parse(typeof(BirdType), type); IBird bird; switch (bt) { case BirdType.Crow: bird = new Bird("Black Crow", bt); bird.Fly = new SimpleFlyActivity(); break; case BirdType.Duck: bird = new Bird("White Pond Duck", bt); bird.Fly = new SmallFlyActivity(); break; case BirdType.Eagle: bird = new Bird("Grey Eagle", bt); bird.Fly = new JetFlyActivity(); break; case BirdType.Owls: bird = new Bird("Brown Owl", bt); bird.Fly = new SmallFlyActivity(); break; case BirdType.Rubber: bird = new Bird("Yellow Rubber Duck", bt); bird.Fly = new NoFlyActivity(); break; case BirdType.Simple: default: bird = new Bird("Simple White Bird", bt); bird.Fly = new SimpleFlyActivity(); break; } Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("________________________"); Console.WriteLine($"{bird.ToString()}"); return(bird); }
public IFly Fly(BirdType b) { IFly fly = null; switch (b) { case BirdType.Glede: fly = new GledeFly(); break; case BirdType.Bird: fly = new BirdFly(); break; default: throw new Exception("12323"); } return(fly); }
/// <summary> /// BullFinch constructor, passed to it is the property values /// This constructor calls the bird constructor (as a BullFinch is a bird) /// </summary> /// <param name="name">Name</param> /// <param name="age">Age</param> /// <param name="gender">Gender</param> /// <param name="typeOfBird">As bullfinch is a bird, type of bird needs to be passed</param> /// <param name="whatToSing">This is a property of bullfinch</param> public Bullfinch(string name, int age, Gender gender, BirdType typeOfBird, string whatToSing) : base(name, age, gender, typeOfBird) { foodSchedule = new FoodSchedule(); foodSchedule.Add("One insect for three times a day."); WhatToSing = whatToSing; }
/// <summary> /// Crow constructor, passed to it is the property values /// This constructor calls the bird constructor (as a Crow is a bird) /// </summary> /// <param name="name">Name</param> /// <param name="age">Age</param> /// <param name="gender">Gender</param> /// <param name="typeOfBird">As bullfinch is a bird, type of bird needs to be passed</param> /// <param name="whatSilverDoCrowLike">This is a crow property</param> public Crow(string name, int age, Gender gender, BirdType typeOfBird, string whatSilverDoCrowLike) : base(name, age, gender, typeOfBird) { foodSchedule = new FoodSchedule(); foodSchedule.Add("Two insect for twice a day."); WhatSilverDoCrowLike = whatSilverDoCrowLike; }
public void KillBird(BirdType birdType) { Birds [(int)birdType - 1].alive = false; }
public Bird(BirdType birdType) { _birdtype = birdType; }
public Bird(string name, BirdType type) { this.BirdName = name; this.BirdType = type; }
public Bird(BirdType type) { _birdType = type; _birdName = type.ToString(); birdSpritePath = CombinePath(defaultPath, _birdName); }
public void SetBirdType(BirdType type) { _bird = new Bird(type); SetSprite(ActionType.Idle); }
public AfricanBird(BirdType birdType) : base(birdType) { }
/// <summary> /// Dog constructor, passed to it is the property values /// This constructor calls the Animal constructor (as a bird is an animal) /// </summary> /// <param name="name">Name of mammal</param> /// <param name="age">Age of mammal</param> /// <param name="gender">gender of mammal</param> /// <param name="typeOfBird">What type of bird this is</param> public Bird(string name, int age, Gender gender, BirdType typeOfBird) : base(name, age, gender) { TypeOfBird = typeOfBird; }
public Bird(BirdType birdType) { this.BirdType = birdType; }
public EuropeanBird(BirdType birdType) : base(birdType) { }
public BirdMisc(GameObject go, BirdType birdType) { gameObject = go; _spriteRenderer = go.GetComponent <SpriteRenderer>(); _bird = new Bird(birdType); }
/// <summary> /// Constructs a new Flappy Bird. /// </summary> /// <param name="type">The Bird Type.</param> public FlappyBird(BirdType type) : base(EntityType.BIRD, START_LOCATION, new Rectangle((int)START_LOCATION.X, (int)START_LOCATION.Y, 24, 24)) { this.type = type; this.physics = new BirdPhysics(); this.flapChange = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; }
public NorwegianBird(BirdType birdType) : base(birdType) { }