public static Unit Spawn(UnitID unitID) { Unit unit = UnitFactory.Create(unitID); if (unit != null) GameManager.TheGameManager.GameObjects.Add(unit); return unit; }
public static Unit Create(UnitID unitID) { switch (unitID) { case UnitID.Regnan: return new Regnan(); case UnitID.AI_Werewolf: return new AIWerewolf(); case UnitID.AITestBoss: return new AITestBoss(); case UnitID.Guard: return new Guard(); case UnitID.Skull: return new Skull(); case UnitID.Slime: return new Slime(); case UnitID.Beholder: return new Beholder(); } return null; }
public CommandGetUnitSettings(UnitID UnitID) { this.UnitID = UnitID; }
public Unit SpawnUnit(UnitID unitID, Vector2 tileCoord) { Unit unit = UnitFactory.Spawn(unitID); if (unit == null) { return null; //throw new Exception("Unknown unit: " + unitID); } unit.Position = Map.TileCoordToPosition(tileCoord); if (unit.ControlledBy == Controller.Player) { controlledUnit = (PlayerUnit)unit; } return unit; }
/// <summary> /// 召唤怪物到时间后要被销毁 /// </summary> static void OnSummonMonsterDisappear(System.Object param) { UnitID uid = (UnitID)(param); ActorManager.Instance.DestroyActor(uid, 0); }
public SystemLastError(UnitID UnitID, Errors Error) { this.UnitID = UnitID; this.Error = Error; }
public static IUnit GetUnit(UnitID unitID) { using (var unitsManager = UnitsManager.CreateInstance()) { return(unitsManager.Units.FirstOrDefault(p => p.ID == unitID)); } }
// 유닛의 이름으로 생성 public Unit CreateUnit(string unitString) { UnitID unitID = (UnitID)Enum.Parse(typeof(UnitID), unitString); return(CreateUnit(unitID)); }
public UUnitT(UnitID id, PrefabCache cache) : base(id, cache, UUnitT.PREFAB_FILE) { this.move_range = 4; this.jump_range = 1; }
public UUnitSphere(UnitID id, PrefabCache cache) : base(id, cache, UUnitSphere.PREFAB_FILE) { }
public XmlNode exportXMLnode() { XmlDocument xmlDoc = new XmlDocument(); StringWriter stringWriter = new StringWriter(); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); XmlNode rootNode = null; if (isNodeComment) { rootNode = xmlDoc.CreateComment(comment); xmlDoc.AppendChild(rootNode); return(rootNode); } rootNode = xmlDoc.CreateElement(aimnType.ToString()); xmlDoc.AppendChild(rootNode); #region IEC61850Server if (slaveType == SlaveTypes.IEC61850Server) { foreach (string attr in arrAttributes) { XmlAttribute attrName = xmlDoc.CreateAttribute(attr); attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this); rootNode.Attributes.Append(attrName); } XmlAttribute attr2 = xmlDoc.CreateAttribute("ReportingIndex"); attr2.Value = iec61850reportingindex.ToString(); rootNode.Attributes.Append(attr2); XmlAttribute attrDataType = xmlDoc.CreateAttribute("DataType"); attrDataType.Value = DataType.ToString(); rootNode.Attributes.Append(attrDataType); XmlAttribute attrCommandType = xmlDoc.CreateAttribute("CommandType"); attrCommandType.Value = CommandType.ToString(); rootNode.Attributes.Append(attrCommandType); XmlAttribute attrDeadband = xmlDoc.CreateAttribute("Deadband"); attrDeadband.Value = Deadband.ToString(); rootNode.Attributes.Append(attrDeadband); XmlAttribute attrMultiplier = xmlDoc.CreateAttribute("Multiplier"); attrMultiplier.Value = Multiplier.ToString(); rootNode.Attributes.Append(attrMultiplier); XmlAttribute attrConstant = xmlDoc.CreateAttribute("Constant"); attrConstant.Value = Multiplier.ToString(); rootNode.Attributes.Append(attrConstant); XmlAttribute attrDescription = xmlDoc.CreateAttribute("Description"); attrDescription.Value = Description.ToString(); rootNode.Attributes.Append(attrDescription); } #endregion IEC61850Server #region GDisplaySlave if (slaveType == SlaveTypes.GRAPHICALDISPLAYSLAVE) { foreach (string attr in arrAttributes) { XmlAttribute attrName = xmlDoc.CreateAttribute(attr); attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this); rootNode.Attributes.Append(attrName); } XmlAttribute attrCellNo = xmlDoc.CreateAttribute("CellNo"); attrCellNo.Value = CellNo.ToString(); rootNode.Attributes.Append(attrCellNo); XmlAttribute attrWidget = xmlDoc.CreateAttribute("Widget"); attrWidget.Value = Widget.ToString(); rootNode.Attributes.Append(attrWidget); XmlAttribute attrUnit = xmlDoc.CreateAttribute("Unit"); attrUnit.Value = UnitID.ToString(); rootNode.Attributes.Append(attrUnit); XmlAttribute attrDescription = xmlDoc.CreateAttribute("Description"); attrDescription.Value = Description.ToString(); rootNode.Attributes.Append(attrDescription); } #endregion GDisplaySlave #region OtherSlave if ((slaveType == SlaveTypes.DNP3SLAVE) || (slaveType == SlaveTypes.IEC101SLAVE) || (slaveType == SlaveTypes.IEC104) || (slaveType == SlaveTypes.MODBUSSLAVE) || (slaveType == SlaveTypes.UNKNOWN) || (slaveType == SlaveTypes.SPORTSLAVE) || (slaveType == SlaveTypes.MQTTSLAVE) || (slaveType == SlaveTypes.SMSSLAVE)) { foreach (string attr in arrAttributes) { XmlAttribute attrName = xmlDoc.CreateAttribute(attr); attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this); rootNode.Attributes.Append(attrName); } } #endregion OtherSlave return(rootNode); }
public Parse_Unit_Files_List() { List <Unit_Files_List> FB_List = parse_Unit_Files_List_FB(@"D:\Games\PS3\EXVSFB JPN\Pkg research\FB Repacker\Repack\PAC\Input\MBON Reimport Project\list_fb.bin"); List <Unit_Files_List> MBON_List = parse_Unit_Files_List_MBON(@"D:\Games\PS3\EXVSFB JPN\Pkg research\FB Repacker\Repack\PAC\Input\MBON Reimport Project\big_endian_list.bin"); List <Unit_Files_List> Combined_List = new List <Unit_Files_List>(); UnitIDList unitIDList = load_UnitID(); List <UnitID> unit_ID_List = unitIDList.Unit_ID; StringBuilder MBONlog = new StringBuilder(); MBONlog.AppendLine("MBON PAC Hashes"); foreach (var MBON in MBON_List) { if (FB_List.Any(x => x.Unit_ID == MBON.Unit_ID)) { Unit_Files_List FBUnit = FB_List.FirstOrDefault(x => x.Unit_ID == MBON.Unit_ID); FBUnit.MBONAdded = false; Combined_List.Add(FBUnit); } else { if (unit_ID_List.Any(x => x.id == MBON.Unit_ID)) { UnitID unit = unit_ID_List.FirstOrDefault(x => x.id == MBON.Unit_ID); MBONlog.AppendLine(@"//----------------------- " + unit.name_english + @"-----------------------//"); // Manually add own made hashes to newly added MBON units Crc32 crc32 = new Crc32(); string sound_effect_str = unit.name_english + "_sound_effects"; string sound_effect_hash = crc32.Get(Encoding.UTF8.GetBytes(sound_effect_str.ToLower())).ToString("X8"); MBONlog.AppendLine(sound_effect_str + " - 0x" + sound_effect_hash); uint.TryParse(sound_effect_hash, out uint result); MBON.sound_effect_PAC_hash = result; string global_pilot_voices_str = unit.name_english + "_global_pilot_voices"; string global_pilot_voices_hash = crc32.Get(Encoding.UTF8.GetBytes(global_pilot_voices_str.ToLower())).ToString("X8"); MBONlog.AppendLine(global_pilot_voices_str + " - 0x" + global_pilot_voices_hash); uint.TryParse(global_pilot_voices_hash, out result); MBON.global_pilot_voices_PAC_hash = result; string sortie_and_awakening_sprites_costume_1_str = unit.name_english + "_sortie_and_awakening_sprites_costume_1"; string sortie_and_awakening_sprites_costume_1_hash = crc32.Get(Encoding.UTF8.GetBytes(sortie_and_awakening_sprites_costume_1_str.ToLower())).ToString("X8"); MBONlog.AppendLine(sortie_and_awakening_sprites_costume_1_str + " - 0x" + sortie_and_awakening_sprites_costume_1_hash); uint.TryParse(sortie_and_awakening_sprites_costume_1_hash, out result); MBON.sortie_and_awakening_sprites_PAC_hash = result; string global_pilot_voice_file_list_str = unit.name_english + "_global_pilot_voice_file_list"; string global_pilot_voice_file_list_hash = crc32.Get(Encoding.UTF8.GetBytes(global_pilot_voice_file_list_str.ToLower())).ToString("X8"); MBONlog.AppendLine(global_pilot_voice_file_list_str + " - 0x" + global_pilot_voice_file_list_hash); uint.TryParse(global_pilot_voice_file_list_hash, out result); MBON.voice_file_list_PAC_hash = result; string local_pilot_voices_str = unit.name_english + "_global_pilot_voices"; string local_pilot_voices_hash = crc32.Get(Encoding.UTF8.GetBytes(local_pilot_voices_str.ToLower())).ToString("X8"); MBONlog.AppendLine(local_pilot_voices_str + " - 0x" + local_pilot_voices_hash); uint.TryParse(local_pilot_voices_hash, out result); MBON.local_pilot_voices_STREAM_PAC_hash = result; MBON.MBONAdded = true; Combined_List.Add(MBON); } } } StreamWriter streamWriter = File.CreateText(@"D:\Games\PS3\EXVSFB JPN\Pkg research\FB Repacker\Repack\PAC\Input\MBON Reimport Project\GeneratedMBONPACHashes.txt"); streamWriter.Write(MBONlog.ToString()); streamWriter.Close(); string json = JsonConvert.SerializeObject(Combined_List, Formatting.Indented); StreamWriter jsonSW = File.CreateText(@"D:\Games\PS3\EXVSFB JPN\Pkg research\FB Repacker\Repack\PAC\Input\MBON Reimport Project\AllUnitsPACHashes.json"); jsonSW.Write(json); jsonSW.Close(); }
protected void lvMDUnit_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 UnitID; Int64.TryParse(e.CommandArgument.ToString(), out UnitID); if (UnitID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _UnitID = UnitID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDUnitEntity.FLD_NAME_UnitID, UnitID.ToString(), SQLMatchType.Equal); MDUnitEntity mDUnitEntity = new MDUnitEntity(); result = FCCMDUnit.GetFacadeCreate().Delete(mDUnitEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _UnitID = 0; _MDUnitEntity = new MDUnitEntity(); PrepareInitialView(); BindMDUnitList(); MiscUtil.ShowMessage(lblMessage, "Unit has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Unit.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public void SaveUnitENV(UnitID UnitID) { _controller.SaveUnitENV(UnitID); }
public CommandSaveUnitENV(UnitID UnitID) { this.UnitID = UnitID; }
// 유닛의 이름으로 해제 public bool ReleaseUnit(string unitString, Unit unit) { UnitID unitID = (UnitID)Enum.Parse(typeof(UnitID), unitString); return(ReleaseUnit(unitID, unit)); }
// 유닛의 타입으로 해제 public bool ReleaseUnit(UnitID unitID, Unit unit) { switch (unitID) { case UnitID.Alice: PoolManager.Instance.Release <Warrior_Alice>("Prefabs/Warrior_Alice", (Warrior_Alice)unit); return(true); case UnitID.Fuyuko: PoolManager.Instance.Release <Warrior_Fuyuko>("Prefabs/Warrior_Fuyuko", (Warrior_Fuyuko)unit); return(true); case UnitID.Kaho: PoolManager.Instance.Release <Warrior_Kaho>("Prefabs/Warrior_Kaho", (Warrior_Kaho)unit); return(true); case UnitID.Shiori: PoolManager.Instance.Release <Archer_Shiori>("Prefabs/Archer_Shiori", (Archer_Shiori)unit); return(true); case UnitID.Ranger: PoolManager.Instance.Release <Archer_Ranger>("Prefabs/Archer_Ranger", (Archer_Ranger)unit); return(true); case UnitID.Serika: PoolManager.Instance.Release <Archer_Serika>("Prefabs/Archer_Serika", (Archer_Serika)unit); return(true); case UnitID.Yuni: PoolManager.Instance.Release <Caster_Yuni>("Prefabs/Caster_Yuni", (Caster_Yuni)unit); return(true); case UnitID.Nian: PoolManager.Instance.Release <Caster_Nian>("Prefabs/Caster_Nian", (Caster_Nian)unit); return(true); case UnitID.Asahi: PoolManager.Instance.Release <Caster_Asahi>("Prefabs/Caster_Asahi", (Caster_Asahi)unit); return(true); case UnitID.Slime: PoolManager.Instance.Release <Slime>("Prefabs/Monster_Slime", (Slime)unit); return(true); case UnitID.Bat: PoolManager.Instance.Release <Bat>("Prefabs/Monster_Bat", (Bat)unit); return(true); case UnitID.Mushroom: PoolManager.Instance.Release <Mushroom>("Prefabs/Monster_Mushroom", (Mushroom)unit); return(true); case UnitID.Skeleton: PoolManager.Instance.Release <Skeleton>("Prefabs/Monster_Skeleton", (Skeleton)unit); return(true); case UnitID.Kong: PoolManager.Instance.Release <Kong>("Prefabs/Monster_Kong", (Kong)unit); return(true); default: return(false); } }
public CommandStop(UnitID UnitID) { this.UnitID = UnitID; }
public CommandMove(UnitID UnitID, int Steps, byte Speed) { this.UnitID = UnitID; this.Steps = Steps; this.Speed = Speed; }
public CommandSetMode(UnitID UnitID, UnitSettings Mode) { this.UnitID = UnitID; this.Mode = Mode; }
public virtual WebUnit GetWebUnit(UnitID unitID) { return(WebUnits.FirstOrDefault(p => p.UnitID == unitID)); }
public string SetIgnoreECC(OnOff state) { return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.UnitSetIgnoreECC, CtlID, UnitID.ToString(), state.ToString().ToLower())); }
public string SetName(string name) { return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.UnitSetName, CtlID, UnitID.ToString(), name)); }
public string SetCache(OnOff state, bool quiet) { var parameter = quiet ? TW_CLI_ParameterType.UnitSetCacheQuiet : TW_CLI_ParameterType.UnitSetCache; return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, parameter, CtlID, UnitID.ToString(), state.ToString().ToLower())); }
public Iid(int nodeId, UnitID unitid) { _node_ID = nodeId; _unit_ID = unitid; }
public CommandSetAccSteps(UnitID UnitID, ushort AccelerationSteps) { this.UnitID = UnitID; this.AccelerationSteps = AccelerationSteps; }