public void Get(List <Employee> employees) { string whatToSay1 = "Hi"; string whatToSay2 = "Hello"; Worker worker = new Worker(); Boss boss = new Boss(); BigBoss bigBoss = new BigBoss(); for (int i = 0; i < employees.Count; i++) { for (int j = 0; j < employees.Count; j++) { if (employees[i].Position.X == employees[j].Position.X && employees[i].Position.Y == employees[j].Position.Y && i != j) { if ((employees[i] is Worker) && (employees[j] is Worker)) { Console.WriteLine("{0} {1} {2}", worker.Say(whatToSay1), employees[i].Name, worker.Talk(worker)); Console.WriteLine(); Console.WriteLine("{0} {1} {2}", worker.Say(whatToSay1), employees[j].Name, worker.Talk(worker)); } else { if ((employees[i] is Boss) && (employees[j] is Boss)) { if ((employees[j] as Boss) is BigBoss) { Console.WriteLine("{0} {1} {2}", boss.Say(whatToSay2), employees[i].Name, boss.Talk(boss)); Console.WriteLine(); Console.WriteLine("{0} {1} {2}", bigBoss.Say(whatToSay2), employees[j].Name, bigBoss.Talk(bigBoss)); } else { Console.WriteLine("{0} {1} {2}", boss.Say(whatToSay1), employees[i].Name, boss.Talk(boss)); Console.WriteLine(); Console.WriteLine("{0} {1} {2}", boss.Say(whatToSay1), employees[j].Name, boss.Talk(boss)); } } else { if ((employees[i] is Worker) && (employees[j] is Boss)) { if ((employees[j] as Boss) is BigBoss) { Console.WriteLine("{0} {1} {2}", bigBoss.Say(whatToSay2), employees[j].Name, bigBoss.Talk(bigBoss)); Console.WriteLine(); Console.WriteLine("{0} {1} {2}", worker.Say(whatToSay2), employees[i].Name, worker.Talk(worker)); } else { Console.WriteLine("{0} {1} {2}", boss.Say(whatToSay2), employees[j].Name, boss.Talk(boss)); Console.WriteLine(); Console.WriteLine("{0} {1} {2}", worker.Say(whatToSay2), employees[i].Name, worker.Talk(worker)); } } } } } } } }
public virtual void Reset() { this.Tiles = new Tile[MAX_X, MAX_Y]; this.Girl = new LittleGirl(LittleGirlStartX, LittleGirlStartY); this.light = new List <Light>(); for (int i = 0; i < numStartLight; i++) { light.Add(new Light(rnd.Next(1, MAX_X * Tile.TILE_SIZE), rnd.Next(1, MAX_Y * Tile.TILE_SIZE))); } this.potion = new List <Potion>(); for (int i = 0; i < numStartPotions; i++) { potion.Add(new Potion(rnd.Next(1, MAX_X * Tile.TILE_SIZE), rnd.Next(1, MAX_Y * Tile.TILE_SIZE))); } this.Girl = new LittleGirl(350, 350); this.bigBoss = new BigBoss((MAX_X * Tile.TILE_SIZE) / 2, 0); smushy = new List <Smushy>(); for (int i = 0; i < numStartSmushy; i++) { smushy.Add(new Smushy(rnd.Next(1, MAX_X * Tile.TILE_SIZE), rnd.Next(1, MAX_Y * Tile.TILE_SIZE))); } for (int x = 0; x < MAX_X; x++) { for (int y = 0; y < MAX_Y; y++) { this.Tiles[x, y] = new Tile(x * Tile.TILE_SIZE, y * Tile.TILE_SIZE); } } DisappatingFogs = new List <DisappatingFog>(); FogEntities = new List <Fog>(); for (int i = 0; i < numStartFog; i++) { FogEntities.Add(new Fog((MAX_X * Tile.TILE_SIZE) / 2, 0)); } Trees = new List <Tree>(); for (int i = 0; i < numStartTrees; i++) { this.Trees.Add(new Tree() { X = rnd.Next(0, MAX_X * Tile.TILE_SIZE), Y = rnd.Next(0, MAX_Y) * Tile.TILE_SIZE - 1 }); } }
private static Worker GetChain() { var programmer = new Programmer(Ranks.Worker); var teamLead = new TeamLead(Ranks.TeamLead); var gameDesigner = new GameDesigner(Ranks.Gamedesigner); var bigBoss = new BigBoss(Ranks.BigBoss); programmer.SetNextWorkStair(teamLead); teamLead.SetNextWorkStair(gameDesigner); gameDesigner.SetNextWorkStair(bigBoss); return(programmer); }
private void Start() { GameObject boss = GameObject.FindWithTag("Boss"); BigBoss bossScript = boss.GetComponent <BigBoss>(); health = bossScript.Health; health.onValueChanged += OnValueChanged; healthBar.maxValue = health.CurrentValue; healthBar.value = healthBar.maxValue; nameTag.text = "Big Boss Name Goes Here!"; }
void Start() { BBoss = this; foreach (MonoBehaviour manager in this.GetMonobehaviorsWithInstanceInChildren <IManager>()) { manager.gameObject.SetActive(true); } foreach (IManager manager in this.GetInterfacesInChildren <IManager>()) { Initialize(manager); } //Make this game object persistent DontDestroyOnLoad(gameObject); }
static void Main(string[] args) { Employee[] employees = new Employee[6]; employees[0] = new Junior(); employees[1] = new Junior(); employees[2] = new Middle(); employees[3] = new Director(); employees[4] = new TeamLead(); employees[5] = new BigBoss(); foreach (var e in employees) { if (e is IManager mgr) { mgr.Manage(); } } }