コード例 #1
0
 private void PropertyStatusChanged(FightStatus fightStatus, PropertyId property)
 {
     if (property == PropertyId.PlaySpellForbidden && fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         AbstractPlayerUIRework view = entityStatus.view;
         if (null != view)
         {
             view.RefreshAvailableActions(recomputeSpellCosts: false);
         }
     }
     if (PropertiesUtility.PreventsAction(property))
     {
         fightStatus.NotifyEntityPlayableStateChanged();
     }
 }
コード例 #2
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            PropertyId property = (PropertyId)propertyId;

            if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus))
            {
                ICharacterObject characterObject2;
                ICharacterObject characterObject = characterObject2 = (entityStatus.view as ICharacterObject);
                if (characterObject2 != null)
                {
                    if (propertyReplaced.HasValue)
                    {
                        PropertyId removedProperty = (PropertyId)propertyReplaced.Value;
                        if (removedProperty != property)
                        {
                            if (PropertiesUtility.IsSightProperty(property))
                            {
                                yield return(TryChangeSightVisual(characterObject, property));
                            }
                            else
                            {
                                yield return(RemovePropertyFromView(characterObject, removedProperty));

                                yield return(PropertyViewChanged(fightStatus, removedProperty));

                                yield return(AddPropertyToView(characterObject, property));

                                yield return(PropertyViewChanged(fightStatus, property));
                            }
                        }
                    }
                    else
                    {
                        if (active)
                        {
                            if (PropertiesUtility.IsSightProperty(property))
                            {
                                yield return(TryChangeSightVisual(characterObject, property));
                            }
                            else
                            {
                                yield return(AddPropertyToView(characterObject, property));
                            }
                        }
                        else if (PropertiesUtility.IsSightProperty(property))
                        {
                            yield return(TryChangeSightVisual(characterObject, null));
                        }
                        else
                        {
                            yield return(RemovePropertyFromView(characterObject, property));
                        }
                        yield return(PropertyViewChanged(fightStatus, property));
                    }
                }
            }
            else
            {
                Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 113, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PropertyChangedEvent.cs");
            }
            FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.PropertyChanged);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("**********************************************");
            Console.WriteLine("***************  INICI   *********************");
            Console.WriteLine("******* ACTUALITZACIO DE DOCUMENTS ***********");
            Console.WriteLine("**********************************************");
            Console.WriteLine("**********************************************");

            string            configPath = AppDomain.CurrentDomain.BaseDirectory + "\\config.ini";
            PropertiesUtility properties = new PropertiesUtility();

            properties.LoadProperties(configPath);

            string timeoutStr = properties.GetProperty("timeout");

            Console.Write("Espera per document: " + timeoutStr + " millisegons");
            Console.WriteLine();
            int timeout = Int32.Parse(timeoutStr);

            string pathList = properties.GetProperty("pathlist");

            Console.WriteLine("Llista ubicada a: " + pathList + "Lista.xlsx");

            string pathExcels = properties.GetProperty("pathexcels");

            Console.WriteLine("Excels ubicats a: " + pathExcels + "*.*");

            Excel.Application application = new Excel.Application();

            string path = pathList + "Lista.xlsx";

            Excel.Workbook  lista   = application.Workbooks.Open(path);
            Excel.Worksheet mySheet = (Excel.Worksheet)lista.Sheets["Hojas"];

            string[] terms    = new string[400];
            int      numTerms = 0;

            Excel.Range dataRange = null;
            for (int row = 1; row < mySheet.Rows.Count; row++)
            {
                dataRange = (Excel.Range)mySheet.Cells[row, 1];
                if (dataRange.Value2 == null)
                {
                    break;
                }
                if (row > 400)
                {
                    break;
                }
                terms[row - 1] = String.Format(dataRange.Value2.ToString());
                numTerms++;
            }
            Console.WriteLine();
            lista.Close(false, path, null);


            for (int i = 0; i < numTerms; i++)
            {
                Excel.Workbook workbook = application.Workbooks.Open(pathExcels + terms[i]);
                workbook.RefreshAll();
                Console.Write(i + 1 + ". Actualitzant... " + pathExcels + terms[i]);
                System.Threading.Thread.Sleep(timeout);
                Console.Write(" ok");
                Console.WriteLine();
                application.DisplayAlerts = false;
                workbook.Save();
                workbook.Close(false, pathExcels + terms[i], null);
                workbook = null;
            }

            Console.WriteLine("**********************************************");
            Console.WriteLine("***************    FI    *********************");
            Console.WriteLine("******* ACTUALITZACIO DE DOCUMENTS ***********");
            Console.WriteLine("**********************************************");
            Console.WriteLine("**********************************************");

            application.Quit();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(application);
        }