public RemoteAnt(Ants ants, int id) { _ants = ants; _id = id; _transaction = new Transaction.RemoteTransaction(this); }
public void InitAnts(IList list) { var antNameList = new List<string>(); foreach (var obj in list) { antNameList.Add(obj.ToString()); } _antNameArray = antNameList.ToArray(); _ants = new Ants[_antNameArray.Length]; _antNames = new Dictionary<string, Ants>(); for (int i = 0; i < _antNameArray.Length; i++) { var ant = new Ants(i, _antNameArray[i]); _ants[i] = ant; _antNames.Add(_antNameArray[i], _ants[i]); } if (!_antNames.ContainsKey(_localAntModel.GetName())) { throw new Exception("Local Ant가 Queen 소속이 아닙니다."); return; } _localAnt = new LocalAnt(_antNames[_localAntModel.GetName()], _localAntModel); StartAnt(); }
public LocalAnt(Ants ants, AntModel model) { _ants = ants; _model = model; _transaction = new Transaction.LocalTransaction(this); }